我的问题:
当使用gunicorn作为我的 WSGI HTTP 服务器时,工头无法找到 Django (wsgi?) 应用程序。
应用结构:
在我的 Django 应用程序中,我的结构如下:
<git_repository_root>/
<django_project_root>/
<configuration_root>/
<git_repository_root>包含项目管理和部署相关的东西(、requirements.txt、Procfile等fabfile.py)
包含我的<django_project_root>Django 应用程序和应用程序逻辑。
最后,<configuration_root>包含 mysettings.py和wsgi.py.
我试过的:
我的Procfile应该是这样的(根据Heroku Docs):
web: gunicorn myapp.wsgi
使用此项目布局运行foreman start时,出现错误:
ImportError: Import by filename is not supported.
什么有效:
如果我将我的 Procfile 从它<git_repository_root>移到<git_repository_root>它在本地工作。推送到 Heroku(注意:Heroku 看到<git_repository_root>)后,我无法扩展任何工作程序/添加进程。我得到以下信息:
Scaling web dynos... failed
! No such process type web defined in Procfile.
我相信无论如何我都想要Procfile-<git_repository_root>那为什么它不起作用?我还尝试将其更改Procfile为:
web: gunicorn myapp/myapp.wsgi
但没有运气。任何帮助将非常感激!