我是新来的heroku和gunicorn,所以我不知道这是如何工作的。但我已经做了一些搜索,我想我已经接近部署我的Django应用程序(1.5.1)。所以我知道我需要一个Procfile具有如何修改Procfile在Heroku的非标准文件夹中运行Gunicorn进程?
web: gunicorn app.wsgi
因为我的目录是有点不同。我不能在根目录
app_project
requirements/
contributors/
app/
app/
settings/
wsgi.py
# Normally Procfile goes here
Procfile
通常应用程序/是根目录下运行gunicorn,但我还是决定组织我的文件夹,这样我的Django应用程序从一些其他的东西分开。由于我必须将Procfile放入heroku的根目录才能识别它,我应该在Procfile中放入什么和/或应该在gunicorn命令中放置什么参数?
注:
web: gunicorn app.wsgi # won't work because Procfile is in a directory above
# I also want to keep the directories as is
# I also don't want to create a secondary git inside the app folder just for heroku
web: gunicorn app.app.wsgi # won't work because I don't want to convert the folder into a python module
我m好奇......为什么你不想将__init__.py文件添加到顶级应用程序/文件夹? – eikonomega 2013-05-08 00:22:03
我试图将\ _ \ _ init \ _ \ _。py添加到相同项目布局的顶级目录中,但它不能解决所有错误。即使你通过项目导入错误,然后有设置导入错误,因为它们不在python路径。所以格雷厄姆的解决方案可能是最好的。 – 2014-10-27 13:25:35