Django GeventsocketiowWorker没有属性';插座';

Django GeventsocketiowWorker没有属性';插座';,django,socket.io,gunicorn,gevent-socketio,Django,Socket.io,Gunicorn,Gevent Socketio,我需要使用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]

我需要使用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似乎有问题,请参阅。 对我来说,它与gunicorn的0.16.1版本一起工作

pip install gunicorn==0.16.1

在某些情况下,安装gevent socketio 0.3.6可能会修复此问题,而无需恢复gunicorn。我有0.3.5-rc2,升级为我解决了这个问题(注意:这不是django中的,但它起作用了。)


pip安装gevent socketio==0.3.6

由gunicorn的此更改引起。


以前用于gevent worker的套接字来自gunicorn套接字,现在它们包装gevent协作套接字。因此,恢复到旧版本的gunicorn不是一个好主意。可能是禁用闪存策略服务器,该服务器将禁用此检查。

以防万一,如果有人想知道,它将在2014年10月启用,并且此解决方案仍然有效。谢谢