I have updated to django 1.5 and am getting the following message:
我已更新到django 1.5并收到以下消息:
SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): localhost:8000
SuspiciousOperation:无效的HTTP_HOST标头(您可能需要设置ALLOWED_HOSTS):localhost:8000
I have tried localhost, 127.0.0.1, localhost:8000 in ALLOWED_HOSTS. I have also tried ['*'] all without success.
我在ALLOWED_HOSTS中尝试过localhost,127.0.0.1,localhost:8000。我也试过['*']都没有成功。
Anybody any ideas where I am going wrong? Works as expected with DEBUG=False
我有什么想法我错了吗?按预期工作,DEBUG = False
1 个解决方案
#1
0
Resolved. I had deploy settings in a different file overriding the allowed_hosts in settings.py. Appologies missed this before posting. Thanks for the responses received.
解决。我在不同的文件中部署了设置,覆盖了settings.py中的allowed_hosts。在发布之前,Appologies错过了这个。感谢收到的回复。
#1
0
Resolved. I had deploy settings in a different file overriding the allowed_hosts in settings.py. Appologies missed this before posting. Thanks for the responses received.
解决。我在不同的文件中部署了设置,覆盖了settings.py中的allowed_hosts。在发布之前,Appologies错过了这个。感谢收到的回复。