2014-02-26 288 views
0

在過去幾個月裏,我一直在將這個django應用程序部署到heroku幾次。今天,我在部署時發生超時,即使我沒有更改任何配置。 Cleaning up..步驟需要很長時間,然後在Collecting static files步驟失敗。有沒有人最近遇到過這個問題?這是一個基礎設施問題或python版本更改或其他?Heroku Django應用程序部署超時

 Cleaning up... 
-----> Collecting static files 

!  Timed out compiling Python app (15 minutes) 
!  See https://devcenter.heroku.com/articles/slug-compiler#time-limit 

Auto packing the repository for optimum performance. 
To [email protected]:x.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:x.git' 
+0

'collectstatic'命令是否等待用戶輸入?你可以傳遞'--noinput',所以它不會提示任何事情。 [鏈接到文檔](https://docs.djangoproject.com/zh/dev/ref/contrib/staticfiles/#django-admin-collectstatic) –

+0

不,我禁用了heroku上的collectstatic。配置可能已經改變或者什麼。我將它重置爲禁用,並設置了顯式的python運行時,並刪除了一些我在外部加載的pip依賴關係。事情似乎現在正在起作用。謝謝! –

回答

0

一些事情得到了這個工作。

Disable collectstatic

$ heroku labs:enable user-env-compile 
$ heroku config:set DISABLE_COLLECTSTATIC=1 

Add explicit python runtime。在我的情況下,我堅持我的工作版本,例如python-2.7.4

從您的requirements.txt中刪除不必要的外部依賴項。現在這可以是特定於應用程序,但我有一個自定義pil和一個django模塊,我並不需要從外部安裝(從bitbucket)。這從來都不是問題。但我只是在這種情況下刪除它們 - Everytime I deploy to heroku I get a Timeout error