Forums

DisallowedHost at /

Invalid HTTP_HOST header: 'xxxxxx'. You may need to add u'xxxxxx' to ALLOWED_HOSTS.

getting this error even if Debug = False and allowed host is set to my domain name.

Setting DEBUG to false no longer allows access via hostnames that aren't in ALLOWED_HOSTS in the most recent versions of Django -- it turned out to be a security flaw.

You say you set it to your domain name -- it needs be an element in a list or a tuple. For example:

ALLOWED_HOSTS =  ["privacyismyth.pythonanywhere.com"]

ALLOWED_HOSTS = ["jeon.pythonanywhere.com"]

Yes, exactly -- if you put that in your settings file then you'll get rid of this error.

Please, don't forget to "Reload" your app at the "Web" tab of your control panel.

Yup, that's a very good point.

how set my webpage in aloowed hosts?

if this is a django webapp, you can set that in your settings.py file