gpt4 book ai didi

django - GeventSocketIOWorker 没有属性 'socket'

转载 作者:行者123 更新时间:2023-12-04 23:04:58 26 4
gpt4 key购买 nike

我需要使用 gunicorn 运行 Django 应用程序。
我阅读了文档,我想我已经按照我应该的方式设置了所有内容,但是当我运行时

gunicorn --worker-class socketio.sgunicorn.GeventSocketIOWorker app.wsgi:application

我收到以下错误消息
2013-02-01 18:25:17 [25394] [INFO] Booting worker with pid: 25394
2013-02-01 18:25:18 [25394] [ERROR] Exception in worker process:
Traceback (most recent call last):
File ".../app-root/data/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker
worker.init_process()
File ".../app-root/data/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 131, in init_process
super(GeventWorker, self).init_process()
File ".../app-root/data/lib/python2.7/site-packages/gunicorn/workers/base.py", line 104, in init_process
self.run()
File ".../app-root/data/lib/python2.7/site-packages/socketio/sgunicorn.py", line 14, in run
self.socket.setblocking(1)
AttributeError: 'GeventSocketIOWorker' object has no attribute 'socket'
Traceback (most recent call last):
File ".../app-root/data/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker
worker.init_process()
File ".../data/lib/python2.7/site-packages/gunicorn/workers/ggevent.py", line 131, in init_process
super(GeventWorker, self).init_process()
File ".../app-root/data/lib/python2.7/site-packages/gunicorn/workers/base.py", line 104, in init_process
self.run()
File ".../app-root/data/lib/python2.7/site-packages/socketio/sgunicorn.py", line 14, in run
self.socket.setblocking(1)
AttributeError: 'GeventSocketIOWorker' object has no attribute 'socket'
2013-02-01 18:25:18 [25394] [INFO] Worker exiting (pid: 25394)

如果我用 django_socketio 运行它,一切正常,我一定会错过一些非常重要的东西。

感谢您的帮助

最佳答案

好像是gunicorn>0.17的问题,见issue #122 .
对我来说,它适用于 gunicorn 0.16.1 版。

pip install gunicorn==0.16.1

关于django - GeventSocketIOWorker 没有属性 'socket',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14656841/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com