2

I have been following the example of miguelgrinberg here. It works fine when run it. I submitted to heroku and works fine too. However when I am trying to integrate with flask-script I get this error:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask_socketio/init.py", line 27, in call raise RuntimeError('You need to use a gevent-socketio server.') RuntimeError: You need to use a gevent-socketio server.

The way I am integrating is using this code:

from flask.ext.script import Manager, Server
from chat import app, socketio

manager = Manager(app)

@manager.command
def run():
    socketio.run(app,
                 host='127.0.0.1',
                 port=5000)

if __name__ == '__main__':
    manager.run()
carlos.rivera
  • 71
  • 1
  • 7
  • 2
    Are you running the server with `manage.py run` or `manage.py runserver`? The latter will definitely give you the error you mention. Make sure your `run()` method is in fact executing, maybe by putting a print statement before the `socketio.run` call. – Miguel Grinberg Sep 25 '15 at 05:41
  • Thanks for your time Miguel, that is the error. I was very careless. Now, I am going to try your last version flask-socketio 1.0b1 to avoid problems with javascript. Thanks for all. I have learned a lot from your blog. @Miguel – carlos.rivera Sep 25 '15 at 06:56
  • Are you using SocketIO Client 0.9.16? I got that error when I accidentally installed the incorrect version. – datashaman Sep 28 '15 at 08:28
  • Yes, I am. That is the version I am using. currently It is working fine. @datashaman – carlos.rivera Sep 29 '15 at 04:08
  • can find your answer via [using flask migrate with flask script flask socketio and application factory](https://stackoverflow.com/questions/30454704/using-flask-migrate-with-flask-script-flask-socketio-and-application-factory) – lmx_xml Jun 19 '18 at 04:45

0 Answers0