2015-06-28 124 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