错误32:使用' python manage.py runserver'运行多个Django站点在Gunicorn-Nginx

时间:2014-12-23 12:53:03

标签: django python-2.7 nginx gunicorn

我有一些在Nginx-Gunicorn服务器上运行的Django站点。但是在某些时候我得到了如下所示的Broken Pipe错误

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 "/root/djangoapps/env/mmiradio/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 143, 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])

错误:[Errno 32]管道破裂

我有' python manage.py runserver'在每个网站的gunicorn配置中,所以怀疑是否会导致问题?正如官方Django所说的那样,永远不要在生产服务器上使用它。

1 个答案:

答案 0 :(得分:0)

您正在运行两台服务器。见这里:

https://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port

runserver命令只是一个方便的小服务器,可用于开发。