Enable debug mode when environment variable DEBUG is set
The change allows setting the environment variable DEBUG to any value
except '0' to enable the django debug mode.
Placing a non-empty file `DEBUG` in the `CONFIG_DIR` has the same
effect (the file is loaded by the `envdir` module).
@@ -40,7 +40,7 @@ if not SECRET_KEY:
SECRET_KEY = get_random_string(50, 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)')
# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = os.path.exists(os.path.join(CONFIG_DIR, 'DEBUG'))
+DEBUG = 'DEBUG' in os.environ and os.environ['DEBUG'] != '0'
# Settings for Prometheus paths and such
PROMGEN_CONFIG = os.path.join(CONFIG_DIR, 'promgen.yml')
