我希望有人能帮忙。我一直试图在ubuntu上启动我的烧瓶应用程序。这个应用程序在dev模式下运行,但是当我尝试使用gunicorn运行它时,我会得到以下错误:
[2022-07-24 21:55:44 +0000] [3710] [INFO] Starting gunicorn 20.1.0
[2022-07-24 21:55:44 +0000] [3710] [INFO] Listening at: http://127.0.0.1:8000 (3710)
[2022-07-24 21:55:44 +0000] [3710] [INFO] Using worker: sync
[2022-07-24 21:55:44 +0000] [3711] [INFO] Booting worker with pid: 3711
Failed to find attribute 'app' in 'app'.
[2022-07-24 21:55:44 +0000] [3711] [INFO] Worker exiting (pid: 3711)
[2022-07-24 21:55:44 +0000] [3710] [INFO] Shutting down: Master
[2022-07-24 21:55:44 +0000] [3710] [INFO] Reason: App failed to load.
Here is my app.py file
from website import create_app
if __name__ == "__main__":
app = create_app()
app.run(debug=True)
这里是场地结构。
网站
有人能帮忙吗?
谢谢
S
发布于 2022-07-25 12:16:06
我发现了问题。必须将app=create_app移至“if”语句的上方。
https://stackoverflow.com/questions/73102470
复制相似问题