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

ALLOWED_HOSTS = ['127.0.0.1', 'localhost']

put it like this

Restart your server afterwards


ALLOWED_HOSTS = ['XXX.iptime.org', 'localhost', '127.0.0.1', 'testserver']


# Application definition

INSTALLED_APPS = [
    'polls.apps.PollsConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

You should edit it like that:

ALLOWED_HOSTS = [ '127.0.0.1', 'localhost', 'testserver', ]

Tags:

Python

Django