2
我正在用Django 1.6和Python 3.4编写一个演示代理服务器。我得到一个错误,当响应有此标题:允许逐跳标头Django
Transfer-Encoding=chunked
的错误是:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
return self.application(environ, start_response)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/handlers/wsgi.py", line 214, in __call__
start_response(force_str(status), response_headers)
File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/wsgiref/handlers.py", line 236, in start_response
assert not is_hop_by_hop(name),"Hop-by-hop headers not allowed"
AssertionError: Hop-by-hop headers not allowed
我发现这样一个问题:Allow hop-by-hop headers in Django proxy middleware但看起来像的Django 1.6没有basehttp._hop_headers
。
我运行服务器python3.4 manage.py runserver
。
请帮
_“带有django的演示代理服务器”_?你为什么在django上写代理服务器?最好使用Python和[werkzeug](http://werkzeug.pocoo.org/docs/0.9/http/#header-utilities)。 – 2014-10-18 13:47:19
与Django 1.6和Python 2.7类似的问题。我怀疑这是manage.py的工作原理。我的团队的另一位成员能够设置在uWSGI下运行的传输编码头,并且运行时没有错误。 – 2015-05-05 22:24:20