realpython/dockerizing-django

Debug enabled in production

Open

#24 opened on Apr 19, 2016

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Python (493 forks)batch import
hacktoberfest

Repository metrics

Stars
 (1,326 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hi,

I just noticed that, with the current setup, debug mode is enabled in production. More specifically:

https://github.com/realpython/dockerizing-django/blob/master/web/docker_django/settings.py#L26

should probably be something like DEBUG = True if os.getenv('DEBUG') == 'True' else False. I use this in my own setup and I prefer the default to be False to avoid accidentally enabling debug mode (e.g. if the setting is forgotten in .env).

I know this is only an example, but I think it's better to show people best practices :-)

Contributor guide