Python 流动烧瓶+;Gunicorn&x2B;索克蒂奥

Python 流动烧瓶+;Gunicorn&x2B;索克蒂奥,python,flask,gunicorn,gevent-socketio,Python,Flask,Gunicorn,Gevent Socketio,我正在为我的flask应用程序运行SocketIOServer,我有一个run.py脚本,如下所示: import sys from idateproto import create_app, run_app if __name__ == "__main__": if len(sys.argv) > 1: create_app(sys.argv[1]) else: create_app('dev') run_app() def r

我正在为我的flask应用程序运行SocketIOServer,我有一个run.py脚本,如下所示:

import sys
from idateproto import create_app, run_app

if __name__ == "__main__":
    if len(sys.argv) > 1:
        create_app(sys.argv[1])
    else:
        create_app('dev')
    run_app()
def run_app():
    # Run the application
    # See flask/app.py run() for the implementation of run().
    # See http://werkzeug.pocoo.org/docs/serving/ for the parameters of Werkzeug's run_simple()
    # If the debug parameter is not set, Flask does not change app.debug, which is set from
    # the DEBUG app config variable, which we've set in create_app().
    #app.run(**app_run_args)
    global app
    global middleware
    SocketIOServer((app.config['HOST'], app.conf`enter code here`ig['PORT']), middleware,namespace="socket.io", policy_server=False).serve_forever()
run_应用程序如下所示:

import sys
from idateproto import create_app, run_app

if __name__ == "__main__":
    if len(sys.argv) > 1:
        create_app(sys.argv[1])
    else:
        create_app('dev')
    run_app()
def run_app():
    # Run the application
    # See flask/app.py run() for the implementation of run().
    # See http://werkzeug.pocoo.org/docs/serving/ for the parameters of Werkzeug's run_simple()
    # If the debug parameter is not set, Flask does not change app.debug, which is set from
    # the DEBUG app config variable, which we've set in create_app().
    #app.run(**app_run_args)
    global app
    global middleware
    SocketIOServer((app.config['HOST'], app.conf`enter code here`ig['PORT']), middleware,namespace="socket.io", policy_server=False).serve_forever()
我像这样运行:python run.py production/dev/test等

现在我想使用gunicorn在生产中运行它,所有在线教程都建议执行以下操作: gunicorn运行:app-c gunicorn-config.py 我的问题是我不想再只运行我的应用程序了。我想告诉gunicorn在SocketIOServer上运行永远服务的方法,我在网上做了很多研究,但找不到实现这一点的方法。请帮忙