Server error 500 Wagtail-admin

Viewed 2828

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?

3 Answers

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.

If you customized your admin try to remove or comment your customizing app from INSTALLED_APPS. Sometimes hooks for admin appear like this.

Related