I am trying to dine my application in VPS mode Debug=False. Debug=Trueworks fine, but when I change it to false, I got this error. I use Apache to render python and Nginx pages to serve my static files. I tried using this [answer]: Debugging Apache / Django / WSGI Bad Request (400) error , but it does not work, at least for me. And this is my wsgi configuration:
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
path = '/var/www/example'
if path not in sys.path:
sys.path.append(path)
And also I added the code below to my settings file:
ALLOWED_HOSTS = [
'.example.com',
'.example.com.',
]
source
share