2015-06-28 122 views
1

下載this指導一步一步。除了使用python 3.4.3pyvenv而不是virtualenv。我已經安裝:在heroku上部署Django項目(python 3.4.3)

  • 的Python 3.4.3
  • 的Django 1.8.2
  • 中的python-psycopg2
  • 的libpq-dev的

我的步驟是:

  1. 的mkdir hellodjango & & cd hellodjango
  2. pyvenv VENV
  3. 源VENV/bin中/激活
  4. PIP安裝Django-工具區(成功)
  5. django-admin.py startproject命令hellodjango。
  6. 創建Procfile(網址:gunicorn hellodjango.wsgi --log文件 - )
  7. 工頭開始(成功併爲您在瀏覽器工作程序)
  8. PIP凍結> requirements.txt
  9. 添加runtime.txt (蟒-3.4.3)
  10. 填充settings.pywsgi.py作爲指南說
  11. Init和提交git倉庫
  12. Heroku的創建(成功)
  13. 混帳推Heroku的主

所以混帳推Heroku的主說(錯誤!):

Counting objects: 14, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (10/10), done. 
Writing objects: 100% (14/14), 2.90 KiB | 0 bytes/s, done. 
Total 14 (delta 0), reused 0 (delta 0) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Python app detected 
remote: -----> Installing runtime ( 
remote: python-3.4.3) 
remote: !  Requested runtime ( 
remote: python-3.4.3) is not available for this stack (cedar-14). 
remote: !  Aborting. More info: https://devcenter.heroku.com/articles/python-support 
remote: 
remote: !  Push rejected, failed to compile Python app 
remote: 
remote: Verifying deploy... 
remote: 
remote: !  Push rejected to cryptic-thicket-7510. 
remote: 
To https://git.heroku.com/cryptic-thicket-7510.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/cryptic-thicket-7510.git' 

正如你所看到的主要錯誤是Requested runtime (remote: python-3.4.3) is not available for this stack (cedar-14).什麼時我做錯了?

+0

變化**的python-3.4.2 ** – madzohan

回答

0

根據this heroku確實支持python 3.4.3。您只需要使用適當的pip版本。所以[PIP 3安裝Django-工具區]而不是[PIP安裝Django,工具區在runtime.txt

+0

您使用安裝工具區局部有版本與服務器上運行的內容無關。 –

+0

我知道,但它工作。不知道爲什麼,也許有人會解釋。 ** pip **的不同版本可能生成不同的requirements.txt文件嗎? – Andrey