Python 如何解决;推送被拒绝,未检测到支持Cedar的应用程序”;Heroku中的错误
这是我的Python 如何解决;推送被拒绝,未检测到支持Cedar的应用程序”;Heroku中的错误,python,django,git,heroku,heroku-toolbelt,Python,Django,Git,Heroku,Heroku Toolbelt,这是我的Django项目结构: 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”的应用程
Django
项目结构:
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”的应用程序
我试图使用codeship
在Heroku
上推送构建,但它给了我以下错误:
! 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'
文件内容:
web: gunicorn Testing.wsgi
requirements.txt的内容:
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
我刚刚从我的私人repo
Bitbucket
中克隆了我的项目,并添加了Procfile
,以便与Heroku
兼容。我试图遵循官方文件,但它只是从零开始关注。我错过了什么?需要帮助 现在终于解决了,但是很难理解将预构建的Django
项目部署到Heroku
的指令,我想在这里解释一下:
假设您的目录结构如下所示:
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项目
现在,在您拥有requirements.txt
的同一目录中添加Procfile
,并使用以下语法进行编辑(记住空格)
基本requirements.txt
应包含:
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
repo推送到Heroku
,则可以使用codeship.io
作为中间工具
每次从本地repo推送时,新版本将自动部署到Heroku环境。是否将
Procfile
和requirements.txt
提交到git并被推送?@YuvalAdam是的!他们都在同一个地方。。。我不知道什么是“代码飞船”,所以你应该对照官方文档检查你的部署过程,你可能会在那里找到你的答案。@YuvalAdam错误现在已经解决了!但是在部署构建之后,我得到了:应用程序错误
这正是我在评论中问你的问题。即使按照你的指示,我也会得到错误。我遵循的过程是1)从github克隆我的项目。2) 使用manage.py进入目录,使用web:gunicorn fbnetworkgraph.wsgi-b0.0.0:$PORT
.3)使用pip freeze>requirements.txt
创建Procfile
。4)将目录更改为一级并运行heroku create
。5) 运行git push heroku master。
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