2013-08-05 44 views
0

我想用Django構建一個應用程序& Heroku。我下面這個教程中的步驟:https://devcenter.heroku.com/articles/django如何用Procfile聲明過程類型?

這裏是我的步驟:

mkdir hellodjango && cd hellodjango 
virtualenv venv --distribute 
source venv/bin/activate 
pip install django-toolbelt 
django-admin.py startproject hellodjango . 

我接着問到創建一個所謂的「Procfile」:

web: gunicorn hellodjango.wsgi 

而且具有它「住在我的項目目錄的根目錄」。我該如何做到這一點(請原諒,如果這似乎是一個非常簡單的問題;我是所有編程的新手,並且發現學習曲線非常陡峭)。

回答

1

您應該創建名稱爲Procfile的文件,並且只需在其中粘貼web: gunicorn hellodjango.wsgi即可。

因此,例如,您的git存儲庫位於:/Users/admin/git/hellodjango/。然後,你需要把Procfile放在這個目錄下。

cd /Users/admin/git/hellodjango/ 
touch Procfile 

用任何文本編輯器打開它並粘貼web: gunicorn hellodjango.wsgi

提交併將更改推送到Heroku雲後,它會自動檢測在Procfile中聲明的應用程序類型並運行它。