如何在Gunicorn中运行带有参数的Flask应用程序?

我有一个文件app.py,其功能如下:create_app_from_args

def create_app_from_args(args) -> flask:
    values = get_values(args)
    return create_app(values)

我在同一文件中也有create_app,该文件通过输入值 list 返回该应用。

现在当我尝试运行时

export ARGS=$args
gunicorn 'app:create_app_from_args("${ARGS}")'
如本link中所述

发送请求时出现以下错误

python3.7/site-packages/flask/app.py",line 1743,in handle_http_exception
    return handler(e)
TypeError: page_not_found() takes 1 positional argument but 2 were given 

我调查了this,但无法解决我的问题。那么,如何通过使用gunicorn

传递的参数运行flask应用程序?

谢谢。

ydgdyan 回答:如何在Gunicorn中运行带有参数的Flask应用程序?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2942980.html

大家都在问