What this thread does
Do first: run manage.py check --deploy against the production settings file.
Short answer
Django’s 6.1 deployment checklist combines application settings, static delivery, HTTPS and operational preparation. Use a production WSGI or ASGI server instead of manage.py runserver. Keep DEBUG=False while addressing deployment problems.
What to do
| Item | Required decision and documented defaults |
|---|---|
DEBUG | Boolean; default False. Keep it False in production. |
SECRET_KEY | Default empty string; supply a unique unpredictable production value outside committed source. Django refuses to start without it. |
ALLOWED_HOSTS | Default []; supply the host/domain strings served by this site. A leading dot matches the domain and subdomains. '*' matches anything and requires your own Host validation. |
STATIC_ROOT | Default None; set an absolute collection-directory path, initially empty. Run collectstatic when static files change. |
STATIC_URL | Default None; configure the serving URL, ending in / when nonempty. Have the web server serve the collected files at that URL. Collection alone does not serve them. |
| HTTPS | Redirect HTTP to HTTPS at the front server. Alternatively, SECURE_SSL_REDIRECT=True enables redirection through SecurityMiddleware; its default is False. |
| Cookies | CSRF_COOKIE_SECURE=True and SESSION_COOKIE_SECURE=True restrict their cookies to HTTPS. Both are booleans defaulting to False; enable after HTTPS is configured. |
| Cross-origin forms | CSRF_TRUSTED_ORIGINS defaults to []. Add required origins for unsafe requests such as POST, including the scheme; the reference permits subdomain patterns such as https://*.example.com. |
| HTTPS behind a proxy | SECURE_PROXY_SSL_HEADER defaults to None; its accepted form is a header/value tuple. The reference example is ("HTTP_X_FORWARDED_PROTO", "https"). |
Only use that proxy tuple when the proxy strips incoming X-Forwarded-Proto, including comma-separated values, and sets it correctly for requests originally made over HTTPS. Otherwise retain None. Incorrect HTTPS detection can cause redirect loops or CSRF failures.
Before launch, review database backups, uploaded-file backups, logging and error reporting. The checklist also requires adapting database, cache and mail configuration to the deployment environment.
Limits and open questions
check --deploy automates some checks; it does not configure the web server or a backup system. The deployment host and proxy behavior are unspecified. No manifest-error diagnosis follows from this checklist alone.
Not for: Flask deployment or running Django’s development server as production hosting.
Sources
- Django documentation — Deployment checklist.
- Django documentation — Settings.
- Django documentation — How to deploy static files.
Checked
2026-11-17; read Django 6.1 deployment checklist, settings reference and static-file deployment guide; no command was run.
Started from a post by @Django documentation; Kyle Gibson, squareborg (Stack Overflow), packaged by the editor. Original post