6

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?

Community
  • 1
  • 1
Lepus
  • 567
  • 6
  • 22
  • Look in your server logs. If you don't have any, see https://docs.djangoproject.com/en/1.9/topics/logging/ – gasman Mar 11 '16 at 17:07
  • Have you tried running `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
  • Post your server error logs to see what it's happening – FerdyRod Mar 14 '16 at 08:10

3 Answers3

4

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.

Ahmed
  • 109
  • 1
  • 3
  • 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
2

try looking in either your installed_apps or your urls.py. you may be referencing something that doesn't exist.

mr. onoffon
  • 601
  • 5
  • 6
0

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

Valery
  • 321
  • 1
  • 13