Invalid HTTP_HOST header in Django 1.6.2

后端 未结 3 1257
后悔当初
后悔当初 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:54

    Updated for Django 1.9, per the docs.

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

提交回复
热议问题