Procfile在Heroku中声明类型->(无)

sgi*_*eno 2 django heroku python-2.7

我被困在通过Procfile在Heroku上运行Django 1.4应用程序。我已经阅读了所有相关文章,并且我确定这不是区分大小写的相关问题,因为我已正确命名为Procfile。这是我的项目结构。注意Procfile与manage.py处于同一级别。

.
??? README.md
??? docs
??? project
?   ??? Procfile
?   ??? client
?   ?   ??? __init__.py
?   ?   ??? __init__.pyc
?   ?   ??? models.py
?   ?   ??? templates
?   ?   ?   ??? welcome.html
?   ?   ??? tests.py
?   ?   ??? views.py
?   ?   ??? views.pyc
?   ??? manage.py
?   ??? wings
?       ??? __init__.py
?       ??? __init__.pyc
?       ??? settings.py
?       ??? settings.pyc
?       ??? urls.py
?       ??? urls.pyc
?       ??? wsgi.py
?       ??? wsgi.pyc
??? requirements.txt
??? static
?   ??? css
?   ??? images
?   ??? js
??? tests
??? uploads
Run Code Online (Sandbox Code Playgroud)

这是Procfile:

web:python manage.py runserver
Run Code Online (Sandbox Code Playgroud)

这是在本地运行它的工头的输出(工作正常)

10:29:28 web.1     | started with pid 595
Run Code Online (Sandbox Code Playgroud)

我正在将其推送到heroku上:

Procfile declares types -> (none)
Run Code Online (Sandbox Code Playgroud)

尝试通过heroku工具栏进行缩放:

$ heroku ps:scale web=1 --app myapp
Scaling web processes... failed
!    Record not found.
Run Code Online (Sandbox Code Playgroud)

我总是通过Web创建我的应用程序,因此我总是需要添加--app参数。可能与我如何创建应用有关的任何问题?

我还尝试了以下方法:

MacBook-Pro-de-Sergio:myapp sergio$ heroku run python project/manage.py runserver
Running `python project/manage.py runserver` attached to terminal... up, run.1
Validating models...

0 errors found
Django version 1.4, using settings 'wings.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Run Code Online (Sandbox Code Playgroud)

这是我的应用程序的日志:

2012-07-18T09:18:51+00:00 heroku[run.1]: Starting process with command `python       project/manage.py runserver`
2012-07-18T09:18:51+00:00 heroku[run.1]: State changed from starting to up
2012-07-18T09:19:16+00:00 heroku[router]: Error H14 (No web processes running) -> GET peoplewings.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=
2012-07-18T09:19:16+00:00 heroku[router]: Error H14 (No web processes running) -> GET peoplewings.herokuapp.com/favicon.ico dyno= queue= wait= service= status=503 bytes=
Run Code Online (Sandbox Code Playgroud)

回答

正如Neil指出的,Procfile应该位于git repo的根目录中。我还必须将Procfile上的主机和端口设置为默认Web服务器指向127.0.0.1:8000,这在heroku上不起作用

web: python project/manage.py runserver 0.0.0.0:$PORT
Run Code Online (Sandbox Code Playgroud)

Nei*_*ton 6

您的Procfile必须位于已推送到Heroku的git存储库的根目录中。