mirror of
https://github.com/thecyberlearn/modern-django-starter.git
synced 2026-08-18 10:12:56 +00:00
33 lines
850 B
Bash
Executable File
33 lines
850 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "🚀 Starting Django application setup..."
|
|
|
|
echo "⏳ Waiting for database..."
|
|
sleep 5
|
|
|
|
echo "📦 Running database migrations..."
|
|
python manage.py migrate --noinput
|
|
|
|
echo "🌐 Ensuring Sites framework is set up..."
|
|
python manage.py migrate sites --noinput
|
|
|
|
echo "👥 Creating user groups..."
|
|
python manage.py create_groups
|
|
|
|
echo "🔗 Setting up social applications..."
|
|
python manage.py setup_social_apps
|
|
|
|
echo "🏠 Configuring site domain..."
|
|
DOMAIN_NAME=${DOMAIN_NAME:-localhost}
|
|
python manage.py configure_site --domain="$DOMAIN_NAME" --name="Django Template"
|
|
|
|
echo "📁 Collecting static files..."
|
|
python manage.py collectstatic --noinput
|
|
|
|
echo "✅ Setup completed successfully!"
|
|
|
|
echo "🚀 Starting Gunicorn server..."
|
|
exec gunicorn --bind 0.0.0.0:8000 --workers 3 --timeout 120 django_project.wsgi:application
|