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



我有一些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])

错误: [错误 32] 管道断裂

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

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

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

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

相关内容

  • 没有找到相关文章

最新更新