我正在研究Django系列入门,并遇到了Heroku的问题。
我一次又一次地完成了这些步骤,在提供Virtualenv设置的虚拟机中运行。当我执行git push heroku master
时,我得到以下输出:
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$ git push heroku master
Counting objects: 11, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (11/11), 3.61 KiB, done.
Total 11 (delta 0), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.3.
-----> Preparing Python runtime (python-2.7.3)
-----> Installing Distribute (0.6.34)
-----> Installing Pip (1.2.1)
-----> Installing dependencies using Pip (1.2.1)
Downloading/unpacking Django==1.4.3 (from -r requirements.txt (line 1))
Running setup.py egg_info for package Django
Downloading/unpacking argparse==1.2.1 (from -r requirements.txt (line 2))
Running setup.py egg_info for package argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Installing collected packages: Django, argparse
Running setup.py install for Django
changing mode of build/scripts-2.7/django-admin.py from 600 to 755
changing mode of /app/.heroku/python/bin/django-admin.py to 755
Running setup.py install for argparse
no previously-included directories found matching 'doc/_build'
no previously-included directories found matching 'env24'
no previously-included directories found matching 'env25'
no previously-included directories found matching 'env26'
no previously-included directories found matching 'env27'
Successfully installed Django argparse
Cleaning up...
-----> Collecting static files
0 static files copied.
-----> Discovering process types
! This format of Procfile is unsupported
! Use a colon to separate the process name from the command
! e.g. python: manage.py runserver 0.0.0.0:$PORT .noreload
! Heroku push rejected, malformed Procfile
To git@heroku.com:quiet-lowlands-3777.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:quiet-lowlands-3777.git'
(blog-venv)vagrant@precise64:/vagrant/projects/microblog$ cat Procfile
python: manage.py runserver 0.0.0.0:$PORT --noreload
我变得有点绝望,有人可以对此有所了解吗?谷歌等已经完成。
答案 0 :(得分:2)
现在想出来,关于http://gettingstartedwithdjango.com的教程在这个问题上还不清楚。 Procfile的内容应为:
web:python manage.py runserver 0.0.0.0:$PORT --noreload
不是
python manage.py runserver 0.0.0.0:$PORT --noreload
将此问题留待其他人参考。