diff mbox series

[layerindex-web,1/4] docker/settings.py: don't enable DEBUG when DEBUG=0

Message ID 20261018214146.67856-2-tim.orling@konsulko.com
State New
Headers show
Series Docker: environment files for dev, staging and production | expand

Commit Message

Tim Orling Oct. 18, 2026, 9:41 p.m. UTC
os.getenv() returns a string, and any non-empty string is true, so
DEBUG=0 (or DEBUG=False) turned debug mode on, exposing tracebacks and
settings on error pages. Only enable it for 1, true or yes.

AI-Generated: Claude Opus 5.5
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 docker/settings.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/docker/settings.py b/docker/settings.py
index 90bc5f4..c33731c 100644
--- a/docker/settings.py
+++ b/docker/settings.py
@@ -7,7 +7,7 @@ 
 
 import os
 
-DEBUG = os.getenv('DEBUG', False)
+DEBUG = os.getenv('DEBUG', '0').lower() in ('1', 'true', 'yes')
 
 ADMINS = (
     # ('Your Name', 'your_email@example.com'),