2014-02-26 58 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