在请求任何URL时获取Django错误

时间:2011-07-06 07:15:14

标签: django centos django-dev-server

我在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次中的一次

2 个答案:

答案 0 :(得分:1)

“Broken pipe”表示目标关闭时文件描述符(在本例中为套接字)仍有传出数据。

在这种情况下,最可能的原因是浏览器在Django开发服务器发送完整响应之前关闭连接。

答案 1 :(得分:0)

有时我会在异常后看到管道损坏,或者在进行跨浏览器/平台测试时从Windows连接到我的Linux机箱。我不确定是什么导致了这些错误,但重新启动Django的开发服务器是我所知道要解决的问题。