Heroku collectstatic does not start during deployment

I have a django application that I am successfully speaking with heroics. When I exit the collectstatic command locally, everything works fine.

python manage.py collectstatic --dry-run --noinput
....
Pretending to copy '/Users/hari/.virtualenvs/bsc2/lib/python2.7/site-packages/django/contrib/admin/static/admin/js/admin/ordering.js'
Pretending to copy '/Users/hari/.virtualenvs/bsc2/lib/python2.7/site-packages/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js'

71 static files copied.

Despite this ... my django admin staticfiles are not used, and I get the admin django site with a bare bone on the hero with Debug set to False.

If I set Debug to True, I get a “rich” admin site on heroku. If the Debug parameter is set to True or False, the "w20> push heroku master" command output has nothing to do with collecting static files.

I tried the helloworld application that uses gunokorn from Heroku, and this displayed a "collection of static" messages. I also tried pasting this piece of code in my urls.py. But that doesn't help either.

from django.conf import settings

if not settings.DEBUG:
    urlpatterns += patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),

Next, I tried to add the following to the heroku configuration

heroku config:add DISABLE_COLLECTSTATIC=0

But that, too, did not show my django admin site with all styles.

Finally, I tried switching to gunicorn with my Procfile, and this also did not display admin styles. Only setting Debug = True works to show my admin styles.

I tried this with Django 1.4.2 and 1.5.1 on Heroku, and none of them show me the "normal" admin site. Is there any way to get my admin files on heroku without going to S3 route.

+5
source share
4 answers

command terminal output has nothing to do with collecting static files.

heroku-buildpack-python: bin/steps/collectstatic, , collectstatic --dry-run --noinput /dev/null -----> Collecting static files. , , , heroku: . ( ;)

collectstatic , ?

heroku run python manage.py collectstatic --dry-run --noinput

, , .

+10
+2

:

I found that I did not have the first element, DJANGO_SETTINGS_MODULE"for example, the collectstatic command line will work, but it does not matter, b / c it was an ephemeral dyno

0
source

throwing it there, as dumb mistakes occur:

I spent a lot of time trying to understand why my module was not found on the hero when it worked normally locally, only to understand that it was ignored by entering .slugignore

0
source

All Articles