using flask-migrate with flask-script, flask-socketio and application factory

六月ゝ 毕业季﹏ 提交于 2019-12-05 12:48:05

Based on the comment by Miguel I found a way which works.

For some reason the following code does not work

manager.add_command("run", socketio.run(
   flask.current_app,
   host='127.0.0.1',
   port=5000,
   use_reloader=False)
)

But this actually works.

@manager.command
def run():
   socketio.run(flask.current_app,
                host='127.0.0.1',
                port=5000,
                use_reloader=False)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!