Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Setting DEBUG = False produces internal server error without any trace or log #282

romanr opened this Issue · 6 comments

2 participants


If I set Debug=True, everything works fine. Once I set DEBUG=False and restart it does not work anymore showing erro page on any URL including /admin. Nothing in logs.


Problem is, if ALLOWED_HOSTS is unset with DEBUG=True it does not trigger fatal error. And with DEBUG=False it triggers fatal error.


ALLOWED_HOSTS is Django settings, which should be safe to skip (has defaults meaning no checking). Are you sure it is cause of the problems?


IF ALLOWED_HOSTS is not present in weblate/, it displays error page for every request.
and ALLOWED_HOSTS is not present in in recent versions.


I receive error by email:

Traceback (most recent call last):

 File "/usr/local/lib/python2.6/dist-packages/Django-1.5.1-py2.6.egg/django/core/handlers/", line 92, in get_response
   response = middleware_method(request)

 File "/usr/local/lib/python2.6/dist-packages/Django-1.5.1-py2.6.egg/django/middleware/", line 57, in process_request
   host = request.get_host()

 File "/usr/local/lib/python2.6/dist-packages/Django-1.5.1-py2.6.egg/django/http/", line 72, in get_host
   "Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host)

It also does not work if ALLOWED HOSTS set as


Weblate only works if ALLOWED_HOSTS is set to actual hostname in quotes.

and ALLOWED_HOSTS is not present in so this makes it a serious hurdle for anyone who does not know this information.


Okay, I finally got to read Django documentation - this setting is required since Django 1.5. Will adjust documentation and sample config to match this change.

@nijel nijel was assigned
@nijel nijel closed this in dac0900
@nijel nijel referenced this issue from a commit
@nijel Add check for ALLOWED_HOSTS into performance report in admin inteface.
This will help detecting users running in debug mode that something is
wrong (issue #282).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.