flask.cli.NoAppException.无法解析 "create_app(config="test.cfg") "中的参数。无法解析 "create_app(config="test.cfg") "中的参数。

问题描述 投票:1回答:1

日安!

这不工作与flask运行。

export FLASK_APP='mypkg:create_app(config="test.cfg")'
flask run

相关的错误msg:

flask.cli.NoAppException: Could not parse the arguments in "create_app(config="test.cfg")".

在gunicorn上,我可以运行。

gunicorn 'mypkg:create_app(config="test.cfg")'

有什么办法让这个工作在 flask run? 我只是不想做一个定制的转轮。

python flask gunicorn
1个回答
0
投票

如果可以的话,可以试试这个。

export FLASK_APP=mypkg:create_app("test.cfg")
© www.soinside.com 2019 - 2024. All rights reserved.