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

错误32:在Gunicorn Nginx中使用“python manage.py runserver”运行多个Django站点,django,python-2.7,nginx,gunicorn,Django,Python 2.7,Nginx,Gunicorn,我有一些Django站点运行在Nginx Gunicorn服务器上。但在某一点上,我得到了如下所示的断管错误 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/SocketServe

我有一些Django站点运行在Nginx Gunicorn服务器上。但在某一点上,我得到了如下所示的断管错误

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]管道破裂
我在每个站点的gunicorn配置中都有“python manage.py runserver”,所以怀疑这是否会导致问题?正如Django官方所说,永远不要在生产服务器上使用它。

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

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

runserver命令只是一个在开发中使用的方便的小服务器。

如果您已经为nginx和gunicorn设置了为什么要在上面使用runserver?我刚刚在nginx终端中使用了一个gunicorn_config.py文件,它可以像/path to env/python/path to env/bin/gunicorn-c/path to project/gunicorn_config.py project.wsgi一样运行,这是导致这个错误的原因吗?坦白地说,我不知道,我从来没有明确使用过任何东西。wsgi,但使用gunicorn+nginx和runserver听上去绝对不好