【发布时间】:2013-08-07 05:44:32
【问题描述】:
我的问题:
当使用 gunicorn 作为我的 WSGI HTTP 服务器时,foreman 无法找到 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> 包含我的settings.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.
我相信我无论如何都希望在我的<git_repository_root> 中使用Procfile - 那么为什么它不起作用呢?我还尝试将Procfile 更改为:
web: gunicorn myapp/myapp.wsgi
但没有运气。任何帮助将不胜感激!
【问题讨论】:
-
措辞/记录良好的问题,顺便说一句。
标签: django deployment heroku