2014-04-02 43 views
1

這是我Django項目結構:如何解決「推拒絕,沒有雪松支持的應用程序檢測到」錯誤的Heroku

Testing 
|_djangoApp 
|_Testing 
| |-- __init__.py 
| |-- settings.py 
| |-- urls.py 
| |-- utils.py 
| |-- wsgi.py 
| 
|_manage.py 
|_Procfile 
|_requirements.txt 
|_README.md 

我使用codeship.io部署構建和它推到Heroku,這配置良好。在heroku我已添加名爲「測試」的應用程序。

我試着用codeship推動建立在Heroku,但它給我以下錯誤:Procfile的

!  Push rejected, no Cedar-supported app detected 

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

內容:requirements.txt的

web: gunicorn Testing.wsgi 

內容:

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。我試圖遵循官方文件,但它只是從頭開始。我在這裏錯過了什麼?需要幫忙!

+0

'Procfile'和'requirements.txt'是否都是git並被推送? –

+1

@YuvalAdam是的!他們都在同一個目錄 –

+0

嗯......我不知道什麼是「codeship」,所以你應該檢查你的部署過程與官方文檔,你可能會在那裏找到你的答案。 –

回答

1

最後,現在解決了,但它是很難理解部署指令預建造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需要ProcfileProcFile或者.txt來運行你的django項目。現在

,在你有requirements.txt和編輯與下面的語法相同的目錄添加Procfile(保持記住空格)

web: gunicorn Testing.wsgi -b 0.0.0.0:$PORT 

基本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 

現在它推到你的帳號。

還有一點,如果你想推Bitbucket回購Heroku那麼你可以使用codeship.io作爲中間工具。

每次從本地倉庫推送時,新版本都會自動部署到Heroku環境中。

+1

這正是我問我在我的評論。 –

+0

@YuvalAdam是的! –

+0

即使按照說明操作,我也會收到錯誤消息。我所遵循的過程是1)從github克隆我的項目。 2)使用manage.py進入目錄,使用'web:gunicorn fbnetworkgraph.wsgi -b 0.0.0.0:$PORT'.3創建'Procfile'。使用'pip freeze> requirements.txt'創建'requirements.txt' .4)將目錄更改爲一級並運行'heroku create'。 5)運行'git push heroku master'。 –

相關問題