Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 调试=错误时错误的请求400_Python_Django_Http Status Code 400_Cookiecutter - Fatal编程技术网

Python 调试=错误时错误的请求400

Python 调试=错误时错误的请求400,python,django,http-status-code-400,cookiecutter,Python,Django,Http Status Code 400,Cookiecutter,当我设置debug=false时,“错误请求400”(生产服务器)有问题。我使用cookiecutter和Django 1.8。 我设置了允许的\u HOSTS=['*']-没有任何结果 在日志中,我有一条消息: Invalid HTTP_HOST header: 'myaddress.here'. You may need to add 'myaddress.here' to ALLOWED_HOSTS. 我尝试了django文档中的代码,但也没有成功: 'handlers': {

当我设置debug=false时,“错误请求400”(生产服务器)有问题。我使用cookiecutter和Django 1.8。 我设置了
允许的\u HOSTS=['*']
-没有任何结果

在日志中,我有一条消息:

Invalid HTTP_HOST header: 'myaddress.here'. You may need to add 'myaddress.here' to ALLOWED_HOSTS.
我尝试了django文档中的代码,但也没有成功:

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

您是否尝试过允许的_HOSTS=['*'、'yourdomain.com'、'www.yourdomain.com'、'123.456.78.91']?

是的,我得到了相同的结果。尝试一下['127.0.0.1'、'localhost'、'www.domain.com'、'domain.com']您重新启动了生产服务器吗?当然可以。问题可能是使用饼干切割器?