📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Django Framework Django Deployment

Django Deployment

5 min read
Connect signals in ready(), use custom Signal class, and avoid hidden ordering dependencies.

Django Deployment

# settings/production.py
DEBUG = False
ALLOWED_HOSTS = ["yoursite.com"]
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

# Build steps
python manage.py collectstatic --noinput
python manage.py migrate

# Gunicorn
gunicorn mysite.wsgi:application --workers 4 --bind 0.0.0.0:8000

# Nginx
location / { proxy_pass http://127.0.0.1:8000; }
location /static/ { root /var/www/mysite; expires 1y; }