flask - 为什么 gunicorn 从不同的目录运行模块?
问题描述
Gunicorn 20.0.4 从不同的目录运行应用程序。文件夹结构:
folder0/
app.py
folder1/
app.py
在这两个app.py
文件中都有一个 Flaskapp
实例。在folder0
中,我跑
$ gunicorn app:app
当我导航到http://localhost:8000时,我看到应用程序folder1
正在运行。
为什么会发生这种情况,我该如何解决?
2020 年 7 月 11 日更新
该应用程序folder0
按预期运行:
$ python3 app.py
当我重命名folder1
并运行gunicorn app:app
时folder0
,它找不到我的模块。
2020 年 7 月 12 日更新
我在这里打开了一个关于此的 github 问题:https ://github.com/benoitc/gunicorn/issues/2378
解决方案
推荐阅读
- kubernetes - 为每个虚拟主机应用 envoyfilter ext_authz
- java - 运行 `mvn endpoints-framework:openApiDocs` 时出现 ClassNotFoundException
- sql-server - 部署 SSIS 包需要 Windows 身份验证?
- ruby - 卢卡斯公式用递归求解。然而公式尚未定义
- matlab - 如何(倾斜)旋转 500 x 1000 矩阵?- MATLAB
- vim - vim - 如何选择和抽出所有评论?
- python - Discord.py 上的轮询系统
- angular - 无法使用默认 PipeDate
- vega - 如何在 *url* 参数上使用 vega 中的动态数据加载示例?
- javascript - 将单选按钮值获取到段落