简体   繁体   English

django 1.5更新ALLOWED_HOSTS失败SuspiciousOperation

[英]django 1.5 update ALLOWED_HOSTS failing SuspiciousOperation

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. 我在ALLOWED_HOSTS中尝试过localhost,127.0.0.1,localhost:8000。 I have also tried ['*'] all without success. 我也试过['*']都没有成功。

Anybody any ideas where I am going wrong? 我有什么想法我错了吗? Works as expected with DEBUG=False 使用DEBUG=False按预期工作

Resolved. 解决。 I had deploy settings in a different file overriding the allowed_hosts in settings.py. 我在不同的文件中部署了设置,覆盖了settings.py中的allowed_hosts。 Appologies missed this before posting. 在发布之前,Appologies错过了这个。 Thanks for the responses received. 感谢收到的回复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM