在heroku上部署Django项目(python 3.4.3)

时间:2015-06-28 14:22:30

标签: python django heroku

我正在逐步指导this。除了我使用 python 3.4.3 pyvenv 而不是 virtualenv 。我安装了:

  • Python 3.4.3
  • Django 1.8.2
  • 蟒-psycopg2
  • 的libpq-dev的

我的步骤是:

  1. mkdir hellodjango&& cd hellodjango
  2. pyvenv venv
  3. source venv / bin / activate
  4. pip install django-toolbelt(success)
  5. django-admin.py startproject hellodjango。
  6. 创建了Procfile(web:gunicorn hellodjango.wsgi --log-file - )
  7. 领班开始(在浏览器中成功并检查工作应用程序)
  8. pip freeze> requirements.txt
  9. 添加runtime.txt(python-3.4.3)
  10. 填写 settings.py wsgi.py 作为指南说明
  11. 初始化并提交git repo
  12. heroku create(success)
  13. git push heroku master(错误!)
  14. 所以 git push heroku master 说:

    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).我做错了什么?

1 个答案:

答案 0 :(得分:0)

根据this,heroku支持python 3.4.3。您只需使用适当的 pip 版本。所以[ pip3 安装django-toolbelt]而不是[ pip 安装django-toolbelt]

相关问题