2012-07-18 55 views
1

我被困在通过Procfile在Heroku上运行Django 1.4应用程序。我已阅读所有相关帖子,我确定这不是一个大小写敏感的相关问题,因为我正确地命名为Procfile。这是我的项目结构。通知Procfile在那个manage.pyProcfile在Heroku中声明类型 - >(none)

. 
├── 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 

这里是Procfile同级别:

web:python manage.py runserver 

这里的领班本地运行它的输出(正常工作)

10:29:28 web.1  | started with pid 595 

我这是推到heroku上:

Procfile declares types -> (none) 

尝试通过Heroku的工具区,以它的规模:

$ heroku ps:scale web=1 --app myapp 
Scaling web processes... failed 
! Record not found. 

我一直通过网络创建我的应用程序,所以我需要始终把--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. 

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

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= 

回答

正如尼尔指出Procfile应在根git回购。 我也不得不对Procfile主机和端口默认的Web服务器指向设置为127.0.0.1:8000

web: python project/manage.py runserver 0.0.0.0:$PORT 

回答

3

你Procfile需要在你的git仓库的根目录下是不会在Heroku工作推到Heroku。

+0

感谢您的快速回复,你为我节省了宝贵的时间! – sgimeno 2012-07-18 09:56:58

2

记录名称和内容之间的空间似乎是很重要的:

用途:

web: python manage.py runserver

,而不是

web:python manage.py runserver

+1

作为一个头:没有空间'工头检查'说,Procfile是好的,即使它在部署时导致Heroku中的这个错误。我希望这是在文档或*固定*,我想(如果你认为这是一个错误)。 – Brandon 2013-07-19 07:54:24