I am trying to troubleshoot a 500 error, as whenever I set DEBUG = False in Django, I receive a 500 error.
I attempted to set ALLOWED_HOSTS = ['*']
I attempted to setup LOGGING to debug and force logging to console with a loop. However, it does not work, so there is a good chance it is not doing what I think it should be doing.
I have attached a snippet from my settings file:
settings.py:
DEBUG = False
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
},
},
}
for logger in LOGGING['loggers']:
LOGGING['loggers'][logger]['handlers'] = ['console']
ALLOWED_HOSTS = ['*']
Server Error (500)
– notlaughing May 26 '20 at 02:49