P
P
pvgdrk2016-04-04 19:38:38
Django
pvgdrk, 2016-04-04 19:38:38

What does the message [Django] ERROR: Invalid HTTP_HOST header... mean?

Set up error logging by mail in the Django project. Now this cart is constantly coming in batches:
[Django] ERROR: Invalid HTTP_HOST header: 'www.somesite.com'. You may need to add u'www.somesite.com' to
ALLOWED_HOSTS What it is?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rostislav Grigoriev, 2016-04-04
@crazyzubr

You need to add 'www.somesite.com' to the project settings found in `settings_local.py` or `settings.py` for the ALLOWED_HOSTS parameter.
For example, like this:
Or allow any hosts:
If the sites are left, that is, not yours, then you can put a stub for these messages in the logging settings:

'loggers': {
      'django.security.DisallowedHost': {
           'handlers': ['null'],
           'propagate': False,
},

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question