我在Django中运行应用程序,并在我的本地runserver终端上收到以下错误:
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[31/Dec/2015 20:32:39] "GET / HTTP/1.1" 500 141859
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 127, in finish_response
self.write(data)
File "/usr/lib/python2.7/wsgiref/handlers.py", line 215, in write
self._write(data)
File "/usr/lib/python2.7/socket.py", line 324, in write
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
Exception happened during processing of request from ('192.168.33.1', 4507)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 582, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/vagrant/Envs/hellobands/local/lib/python2.7/site-packages/django/c
ore/servers/basehttp.py", line 126, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 640, in __init__
self.finish()
File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
self.wfile.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
我完全不知道从哪里开始尝试解决这个问题;有没有人见过这种错误类型?我将从哪里开始尝试调试它?
答案 0 :(得分:2)
客户端(可能是您的Web浏览器)在Django的开发服务器期望之前关闭了连接。错误消息是无害的,虽然不整洁,并且不会在生产中发生,仅在开发服务器上。
这些错误在a patch to Django 13 months ago中被抑制,因此您可以通过升级到较新版本的Django来消除这些错误。