我被困在通過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