无法将Django应用程序推送到Heroku - 推送被拒绝

时间:2013-08-24 23:41:40

标签: django heroku

每次将我的Django应用程序推送到Heroku时,我都会遇到几个错误,我正在Heroku的网站上浏览Getting Started with Django on Heroku教程。

我可以在本地看到it worked页面,但Heroku不接受推送,错误如下所示:

$ git push heroku master
Counting objects: 14, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (14/14), 2.64 KiB, done.
Total 14 (delta 1), reused 0 (delta 0)

-----> Python app detected
-----> Preparing Python runtime (python-3.3.2)
-----> Installing Distribute (0.6.36)
-----> Installing Pip (1.3.1)
-----> Installing dependencies using Pip (1.3.1)
   Exception:
   Traceback (most recent call last):
     File "/app/.heroku/python/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/basecommand.py", line 139, in main
       status = self.run(options, args)
     File "/app/.heroku/python/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/commands/install.py", line 240, in run
       for req in parse_requirements(filename, finder=finder, options=options):
     File "/app/.heroku/python/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py", line 1354, in parse_requirements
       line, comes_from=comes_from, default_vcs=options.default_vcs)
     File "/app/.heroku/python/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py", line 76, in from_editable
       res = cls(name, comes_from, source_dir=source_dir, editable=True, url=url)
     File "/app/.heroku/python/lib/python3.3/site-packages/pip-1.3.1-py3.3.egg/pip/req.py", line 43, in __init__
       req = pkg_resources.Requirement.parse(req)
     File "/app/.heroku/python/lib/python3.3/site-packages/distribute-0.6.36-py3.3.egg/pkg_resources.py", line 2681, in parse
       reqs = list(parse_requirements(s))
     File "/app/.heroku/python/lib/python3.3/site-packages/distribute-0.6.36-py3.3.egg/pkg_resources.py", line 2606, in parse_requirements
       line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
     File "/app/.heroku/python/lib/python3.3/site-packages/distribute-0.6.36-py3.3.egg/pkg_resources.py", line 2574, in scan_list
       raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
   ValueError: ('Expected version spec in', 'Django-origin/HEAD', 'at', '/HEAD')

   Storing complete log in /app/.pip/pip.log

!     Push rejected, failed to compile Python app

To git@heroku.com:grantcontrol.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:grantcontrol.git'

这是我的requirement.txt [Django开发主干,Python是3.3.2]

-e git://github.com/django/django.git@f4e9804567ce45ef01f6613ce194e96d293ac04b#egg=Django-origin/HEAD
dj-database-url==0.2.2
gunicorn==17.5

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我将requirements.txt的{​​{1}}条目修改为

Django

这解决了这个问题。