Python 调试=错误时错误的请求400
当我设置debug=false时,“错误请求400”(生产服务器)有问题。我使用cookiecutter和Django 1.8。 我设置了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': {
允许的\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']您重新启动了生产服务器吗?当然可以。问题可能是使用饼干切割器?