首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决Heroku中的“拒绝推送,未检测到雪松支持的应用程序”错误

如何解决Heroku中的“拒绝推送,未检测到雪松支持的应用程序”错误
EN

Stack Overflow用户
提问于 2014-04-02 10:32:46
回答 1查看 2.7K关注 0票数 1

这是我的Django项目结构:

代码语言:javascript
复制
Testing
|_djangoApp
|_Testing
| |-- __init__.py
| |-- settings.py
| |-- urls.py
| |-- utils.py
| |-- wsgi.py
|
|_manage.py
|_Procfile
|_requirements.txt
|_README.md

我使用codeship.io部署构建并将其推送到配置良好的Heroku。在heroku上,我添加了一个名为"Testing“的应用程序。

我试图使用Heroku将构建推到codeship上,但是它给了我以下错误:

代码语言:javascript
复制
 !     Push rejected, no Cedar-supported app detected

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

Procfile的内容:

代码语言:javascript
复制
web: gunicorn Testing.wsgi

Requirements.txt的内容:

代码语言:javascript
复制
Django==1.3.1
docutils==0.8.1
psycopg2==2.4.2
Fabric==1.3.2
South==0.7.3
gunicorn==0.13.4
newrelic==1.0.5.156
django-celery==2.4.2
django-kombu==0.9.4
django-storages==1.1.3
boto==2.1.1
pylibmc==1.2.2
django-pylibmc-sasl==0.2.4
django-sorting==0.1
django-guardian==1.0.3
django-pagination==1.0.7
pyst2==0.4
django-annoying==0.7.6
django-tastypie==0.9.11
django-coverage==1.2.1
django-nose==0.1.3
nosexcover==1.0.7
django-debug-toolbar==0.8.5
Sphinx==1.1.2
django-cache-machine==0.6
django-twilio

我刚刚从Bitbucket的私人回购中克隆了我的项目,并添加了Procfile以使Heroku兼容。我试图跟踪官方文档,但它只是从零开始关注。我在这里错过了什么?需要帮助!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-03 13:41:51

最后,它现在已经解决了,但是很难理解如何将预构建的Django项目的指令部署到Heroku,我想在这里解释一下:

假设您的目录结构如下所示:

代码语言:javascript
复制
Testing
|_djangoApp
|_Testing
| |-- __init__.py
| |-- settings.py
| |-- urls.py
| |-- utils.py
| |-- wsgi.py
|
|_manage.py
|_requirements.txt
|_README.md

您可以在命令行中使用:python manage.py runserver运行

但是Heroku需要Procfile而不是ProcFile.txt来运行django项目。

现在,将Procfile添加到具有requirements.txt的目录中,并使用以下语法进行编辑(请记住空格)

代码语言:javascript
复制
web: gunicorn Testing.wsgi -b 0.0.0.0:$PORT

基本requirements.txt应该包含:

代码语言:javascript
复制
Django==1.4
simplejson==2.2.1
lxml==2.3.5
pyyaml==3.10
fabric==1.4.3
unittest2==0.5.1
mock==1.0b1
psycopg2==2.4.5
dj-database-url==0.2.1
gunicorn==0.14.6
gevent==0.13.7
greenlet==0.4.0
boto==2.5.2
django-storages==1.1.5
django-ses==0.4.1 #remove this if you don't use Amazon SES
redis==2.7.1
django-celery==3.0.11
South==0.7.6

现在将其推入您的heroku帐户。

还有一点,如果您想将Bitbucket回购推送到Heroku,那么您可以使用codeship.io作为中间工具。

每次从本地回购中推送时,新构建将自动部署到Heroku环境中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22808677

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档