我是新來的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