Invalid HTTP_HOST header in Django 1.6.2

后端 未结 3 1275
后悔当初
后悔当初 2021-01-18 09:33

I am receiving a lot of Invalid HTTP_HOST header messages from my Django web application-

[Django] ERROR: Invalid HTTP_HOST header: \'www.bing.com\'.Y

3条回答
  •  臣服心动
    2021-01-18 09:39

    Here is a complete logging config that can be cut and pasted into a Django 1.6 settings file if LOGGING isn't already defined. This is a follow up to the snippet that @Devang posted as a comment above.

    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'handlers': {
            'null': {
                'class': 'django.utils.log.NullHandler',
            },
        },
        'loggers': {
            'django.security.DisallowedHost': {
                'handlers': ['null'],
                'propagate': False,
            },
        }
    }
    

提交回复
热议问题