【发布时间】:2021-08-20 12:58:59
【问题描述】:
我的项目结构是这样的
git_root/
-django_project_root/
--core/
---...
---settings.py
---wsgi.py
---...
--app1/
--...
Procfile
...
所以我在 git_root 中有 Procfile,在 django_project/core/ 中有 wsgi 我的 Procfile 看起来像这样
web: gunicorn --preload django_project.core.wsgi
Heroku 日志:
ModuleNotFoundError: No module named 'core'
附:还尝试了接下来的 2 件事
- 尝试将 Procfile 放入 django_project 文件夹。但是部署的时候没有找到。
- 创建了新的 repo 并解开了 django_project,所以 git_root 现在是 django_project。并将 Procfile 编辑为如下所示
web: gunicorn --preload core.wsgi
这很奏效。但我需要它来处理初始回购。
【问题讨论】:
标签: django heroku gunicorn modulenotfounderror