Skip to main content
CriticalInfo disclosureOWASP A05:2021CWE-489

How to fix: Django technical 500 debug page exposed

A Django debug error page (yellow screen) is visible, indicating DEBUG=True in the production environment.

Why it matters

Django debug pages expose full Python tracebacks with every local variable at each stack frame, all Django settings (including SECRET_KEY if it appears in a traceback), and installed apps: a critical information disclosure.

DEBUG = True must never be used in production. It enables verbose error pages and can expose SECRET_KEY and database credentials via traceback local variables.

How to fix it

  1. 1Set DEBUG = False in production settings
  2. 2Set ALLOWED_HOSTS to your actual domain names
  3. 3Configure a proper error logging backend (Sentry, logging module)

Code examples

settings/production.py

Python
DEBUG = False
ALLOWED_HOSTS = ["yoursite.com", "www.yoursite.com"]

LOGGING = {
  "version": 1,
  "handlers": { "file": { "class": "logging.FileHandler", "filename": "/var/log/django.log" } },
  "root": { "handlers": ["file"], "level": "WARNING" },
}

References

Detected automatically by VulnRadar. The check id is django-debug-page-exposure, stable across every scan so you can filter or diff on it.

See every info disclosure check

Questions

How severe is Django technical 500 debug page exposed?
VulnRadar rates this critical severity in the info disclosure category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id django-debug-page-exposure, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Django technical 500 debug page exposed map to?
It maps to CWE-489. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for django technical 500 debug page exposed

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Django technical 500 debug page exposed fix | VulnRadar