Currently I'm deploying a Wagtail project. It seems everything working fine so far but there is one issue I can't get rid of. When I'm trying to access the Wagtail admin url I get an internal server error since I changed my settings
file DEBUG
to False
. That's not the case when I access django-admin. Generally the whole Site is working fine without errors.
I found this post. But my 500.html template is not extending base.html and I'm also not using Compress.
Any Ideas how I could solve this?
try looking in either your installed_apps or your urls.py. you may be referencing something that doesn't exist.
Try to run:
python manage.py collectstatic
Missing static files when DEBUG = False
will cause 500 server error.
To see exactly what was the issue enable logging to a file by adding the following to the settings module (generally: settings.py):
#'''
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt' : "%d/%b/%Y %H:%M:%S"
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': 'your_site_name.log',
'formatter': 'verbose'
},
},
'loggers': {
'django': {
'handlers':['file'],
'propagate': True,
'level':'DEBUG',
},
'MYAPP': {
'handlers': ['file'],
'level': 'DEBUG',
},
}
}
#'''
This will log details about the error in 'your_site_name.log' in your project directory (you can also provide an absolute path).
When finished debugging just remove the first hash '#' from the code above to comment it and keep it for future debugging.
-
Did you have the same problem? And is that really a solution to this specific problem? Missing static files do not generally do not cause pages to return 500 errors. They'll just break styling, scripts and images. – malberts Feb 14 '19 at 18:14
python manage.py check --deploy
on your production server? It may give you a hint as to why things aren't working. – rnevius Mar 11 '16 at 17:07