我被困在通过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
感谢您的快速回复,你为我节省了宝贵的时间! – sgimeno 2012-07-18 09:56:58