Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 允许逐跳标头Django_Python_Django_Wsgi_Chunked - Fatal编程技术网

Python 允许逐跳标头Django

Python 允许逐跳标头Django,python,django,wsgi,chunked,Python,Django,Wsgi,Chunked,我正在用Django 1.6和Python 3.4编写一个演示代理服务器。当响应包含以下标题时,我收到一个错误: 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

我正在用Django 1.6和Python 3.4编写一个演示代理服务器。当响应包含以下标题时,我收到一个错误:

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
我发现了这个问题:但Django 1.6似乎没有
basehttp.\u-hop\u头文件

我使用
python3.4 manage.py运行服务器


请帮助

以下HTTP/1.1头是wsgiref不允许的逐跳头:

  - Connection
  - Keep-Alive
  - Proxy-Authenticate
  - Proxy-Authorization
  - TE
  - Trailers
  - Transfer-Encoding
  - Upgrade
见:

  • wsgiref的代码:


  • “带有django的演示代理服务器”?为什么要用django编写代理服务器?最好使用Python和类似的东西。Django 1.6和Python 2.7也有类似的问题。我怀疑这就是manage.py的工作方式。我的团队的另一名成员能够设置在uWSGI下运行的传输编码头,并且它运行时没有错误。
    \u hop\u头现在处于运行状态。