Django's docs are blunt: never run production with DEBUG on. With it off, visitors see a plain error page, and the traceback goes to your logs (or to the admins' email, if configured). Read those. Two common production problems: every page returning 400 Bad Request, which usually means your domain isn't in ALLOWED_HOSTS, and missing styles, which usually means static files weren't collected or aren't served.
What's the problem
Your Django site shows "Server Error (500)", "Bad Request (400)" on every page, missing CSS, or database errors after a deploy.
Why it happens
ALLOWED_HOSTSdoesn't include the domain being used (400 on every page).- An exception in a view, often a database or outside API call.
- Migrations not run on production.
- Static files not collected or not served.
- Environment settings (secret key, database URL) missing in production.
- The app server (Gunicorn, uWSGI) crashed behind Nginx (502).
How to fix it
- Read your app server logs for the traceback.
- For 400 on every page, add your domain (and
www) toALLOWED_HOSTS. - Run migrations on production.
- Run
collectstaticand check your web server serves the static folder. - Check production environment settings.
- Keep
DEBUG = Falsein production.
What Preventionlabs checks
One click runs the full report on your domain. For this problem it shows whether your site loads, how fast, and where its redirects go; up to 50 pages from your sitemap, listing any that fail or are slow, plus broken links on them. With Cloudflare connected, it also shows which pages returned server errors (5xx) to visitors, and when; recent deploys and account changes, with their times. It doesn't read your server logs, so the exact error message is in your host's logs.
Run your free reportYour first report is free, no card needed. Then A$50 a month, up to 10 domains. Read-only: it never changes anything.
Sources
Preventionlabs is independent and not affiliated with Django. Product names are used only to describe the problem.
← All of Frameworks