Wagtail returns 500 error on Debug = False

Related searches

I can't seem to get my site to display when I set Debug = False in my settings file after getting it to run using a standard setup of wagtail start . If I runserver it runs fine. I change the setting to Debug = False and my site shows the 500 error page.

Just the basic settings file:

from .base import *

# SECURITY WARNING: don't run with debug turned on in production!
#DEBUG = True
DEBUG = False

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'c1=mbs2t*!^omg&i0xfo_=mle)%_oegt-&@gn)vx5cs0foe%l9'

# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = ['*']

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'


try:
    from .local import *
except ImportError:
    pass

Django 2.2.1 Wagtail 2.5

It turns out I had to collectstatic files.

Internal Server Error when DEBUG = False � Issue #855 � wagtail , Hi all, Just deployed my vanilla app to Heroku and I started receiving "Bad Request" responses from any URL. After some investigation I've� Check that you have the 400.html and 500.html templates, those are the primary suspects if sites do 500s when DEBUG is set to False

I think this same thing caught me a while back. It's because the browser looks for a /favicon.ico file and for some reason Wagtail or Django tries to pass it to a view instead of just 404ing. Try to add the following in the head of your base.html template and see how it goes. Correcting the link to the file path below as needed.

<link rel="shortcut icon" href="{% static 'images/favicon.ico' %}"/>

Configuring Django for Wagtail — Wagtail 2.0 documentation, If you use the False setting, keep in mind that serving your pages both with and these are used to identify popular search terms for promoted search results. send an email to # the site admins on every HTTP 500 error when DEBUG=False . This is not a very broad article and is typical of the closed minded attitude that php and apache developers have. There is not .htaccess file for IIS.

When Django runs with DEBUG=False you won't get the yellow error pages. That doesn't mean those errors are not raised.

Just configure logging and inspect the logs. https://docs.djangoproject.com/en/2.2/topics/logging/#django-s-default-logging-configuration

Without a traceback it is hard to solve any issue.

This is how you log to a file:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'file': {
            'level': 'DEBUG',
            'class': 'logging.FileHandler',
            'filename': '/path/to/django/debug.log',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'DEBUG',
            'propagate': True,
        },
    },
}

This is the Django default logging: https://github.com/django/django/blob/stable/2.2.x/django/utils/log.py

Configuring Django for Wagtail — Wagtail 2.7 documentation, When WAGTAIL_APPEND_SLASH is False , requests to Wagtail pages will be these are used to identify popular search terms for promoted search results. send an email to # the site admins on every HTTP 500 error when DEBUG=False . The only tangible logging # performed by this configuration is to send an email to # the site admins on every HTTP 500 error when DEBUG=False. # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration.

Why am I getting a 500 server error when debug=False in , When debug=True the Heroku app works fine, however, when I … Why am I getting a 500 server error when debug=False in production? arrest in queryset: data.append(arrest.charge) labels.append(arrest.charge) return render(request, � When DEBUG = False, Django doesn’t work at all without a suitable value for ALLOWED_HOSTS. This setting is required to protect your site against some CSRF attacks. If you use a wildcard, you must perform your own validation of the Host HTTP header, or otherwise ensure that you aren’t vulnerable to this category of attacks.

DEBUG = False causes server error (500), I have a problem with setting DEBUG = False, which gives a 500 error, even with line 27, in get return render(request, self.template_name, template_context) From your app directory, you can safely remove admin.py and views.py, since Wagtail will provide this functionality for your models. Configuring Django to load Wagtail involves adding modules and variables to settings.py and URL configuration to urls.py.

7 Using Get-ChildItem -Exclude or -Include returns nothing Jul 8 '16 4 Angular ng-grid filter on only two columns Mar 28 '13 3 Five equal columns in twitter bootstrap Mar 12 '14

Comments
  • Was this after an upgrade to wagtail by chance? That is what happened to me. Glad I came across your question and answer!
  • That didn't fix it for me. Still getting the 500 error template.
  • It appears if I collectstatic then my site runs. However, if I map the static file outside of the project and collectstatic, it will not run under DEBUG = False. I'm not sure how to go about setting up my settings file. The collectstatic runs, the files show up under DEBUG = True as the right urls. But setting DEBUG = False puts up the 500 error.
  • Didn't fix it for me either... Getting the 500 error without any error / logs anywhere.
  • @Fonz001 Do you have logging set up in whatever settings file you're running off of? With debug off it won't automatically log anything until you configure logging.
  • @Neum that didn't help. I have logging setup. I did notice that the admin area gives a proper stacktrace: ` Internal Server Error: /nl/admin/images/ ... File "/home/wagtail/.local/lib/python3.6/site-packages/django/contrib/staticfiles/storage.py", line 420, in stored_name raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name) ValueError: Missing staticfiles manifest entry for 'wagtailadmin/js/vendor/modernizr-2.6.2.min.js` However, the frontend just gives this as stacktrace: Internal Server Error: /