0

I have a problem with a "Bad Request 400" (the production server) when I have set debug = false. I use cookiecutter and Django 1.8. I set ALLOWED_HOSTS = ['*'] - without any result.

In the logs I have a message:

Invalid HTTP_HOST header: 'myaddress.here'. You may need to add 'myaddress.here' to ALLOWED_HOSTS.

I tried the code that is placed in the documentation django, also without success:

'handlers': {
    'null': {
        'class': 'logging.NullHandler',
    },
},
'loggers': {
    'django.security.DisallowedHost': {
        'handlers': ['null'],
        'propagate': False,
    },
},
mark
  • 653
  • 1
  • 10
  • 23

1 Answers1

0

Did you tried ALLOWED_HOSTS = ['*','yourdomain.com','www.yourdomain.com','123.456.78.91']?

Dmitry Yudin
  • 1,033
  • 1
  • 10
  • 31