将django-app推送到heroku

时间:2013-01-29 08:43:12

标签: django git deployment heroku procfile

我有一些Django项目,希望在Heroku上部署。 我正在尝试将我的应用程序推送到heroku,我收到以下消息:

$ git push heroku master
Counting objects: 22, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 5.04 KiB, done.
Total 22 (delta 0), reused 0 (delta 0)
 !     Heroku push rejected, no Cedar-supported app detected

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

文件列表:

$ git ls-files
.gitignore
Procfile
project/__init__.py
project/apps/main/__init__.py
project/apps/main/admin.py
project/apps/main/forms.py
project/apps/main/models.py
project/apps/main/tests.py
project/apps/main/views.py
project/environ.py
project/manage.py
project/project/__init__.py
project/project/settings.py
project/project/urls.py
project/project/wsgi.py
requerements.txt

git config

$ cat .git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "heroku"]
    url = git@heroku.com:fierce-tor-2115.git
    fetch = +refs/heads/*:refs/remotes/heroku/*

我的Procfile:

$ cat Procfile 
web: python project/manage.py runserver 0.0.0.0:$PORT --noreload

我的requirements.txt文件:

$ cat requerements.txt 
Django==1.5c1
psycopg2==2.4.6

我使用下一个命令创建的Heroku App:

heroku create -s cedar

2 个答案:

答案 0 :(得分:0)

作为解决方法,我建议您查看本指南 https://devcenter.heroku.com/articles/django  并尝试按照指南中的步骤推送测试空项目。

如果它成功推送尝试找到差异(例如我知道heroku区分大小写)。

答案 1 :(得分:0)

在您的文件列表中显示requerements.txt,并且应为requirements.txt