我试图在pythonanywhere上部署我的 django 应用程序。
来自 apache 错误日志的回溯:
2013-07-23 09:31:35,058 :Internal Server Error: /favicon.ico
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 89, in get_response
response = middleware_method(request)
File "/usr/local/lib/python2.7/dist-packages/django/middleware/common.py", line 55, in process_request
host = request.get_host()
File "/usr/local/lib/python2.7/dist-packages/django/http/__init__.py", line 179, 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): monty_singh.pythonanywhere.com
我试过['*']
并['monty_singh.pythonanywhere.com']
作为值,ALLOWED_HOSTS
但应用程序仍然无法正常工作。无论我设置什么值,ALLOWED_HOSTS
我都会得到同样的错误。