我在 Django 的开发服务器上运行 Django。之前它工作正常,但从昨天开始,我不断在运行服务器的 linux 命令行上收到此错误。
Exception happened during processing of request from ('57.xx.xx.123', 63721)
Traceback (most recent call last):
File "/opt/python27/lib/python2.7/SocketServer.py", line 284, in _handle_reque st_noblock
self.process_request(request, client_address)
File "/opt/python27/lib/python2.7/SocketServer.py", line 310, in process_reque st
self.finish_request(request, client_address)
File "/opt/python27/lib/python2.7/SocketServer.py", line 323, in finish_reques t
self.RequestHandlerClass(request, client_address, self)
File "/opt/python27/lib/python2.7/site-packages/django/core/servers/basehttp.p y", line 570, in __init__
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
File "/opt/python27/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/opt/python27/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/opt/python27/lib/python2.7/socket.py", line 301, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
谁能告诉我为什么它现在开始发生
10 次中只有 1 次发生这种情况
最佳答案
“损坏的管道”意味着当目标关闭时,文件描述符(在本例中为套接字)上仍有传出数据。
在这种情况下,最可能的原因是浏览器在 Django 开发服务器发送完整响应之前关闭了连接。
关于django - 请求任何 url 时 Django 出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6592815/