【问题标题】:Getting error with Django while requesting any url请求任何 url 时 Django 出错
【发布时间】:2011-09-29 09:16:04
【问题描述】:

我在 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 次

【问题讨论】:

    标签: django centos django-dev-server


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      有时我会在异常发生后看到管道损坏,或者在进行跨浏览器/平台测试时从 Windows 连接到我的 Linux 机器时。我不确定是什么原因导致了这些错误,但我只知道重启 Django 的开发服务器来修复它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-12-21
        • 2019-11-20
        • 2022-10-20
        • 2021-12-21
        • 1970-01-01
        • 1970-01-01
        • 2016-01-06
        相关资源
        最近更新 更多