2013-08-05 46 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中声明的应用程序类型并运行它。