我已经为我的django app安装了哨兵,刚刚从debug = True切换到False。 自从我做了这个改变之后,我每10分钟就会记录一次错误。
这是完整的错误:
Traceback (most recent call last):
File "/home/ubuntu/postalenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 92, in get_response
response = middleware_method(request)
File "/home/ubuntu/postalenv/local/lib/python2.7/site-packages/django/middleware/common.py", line 57, in process_request
host = request.get_host()
File "/home/ubuntu/postalenv/local/lib/python2.7/site-packages/django/http/request.py", line 72, in get_host
"Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host)
SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): localhost
在我的allowed_hosts中,我已经包含了我的域名。知道这是由什么引起的吗?