I have a django app that I am successfully deplying to heroku. When I dry-run the collectstatic command locally everything works fine.
python manage.py colle
Check this out Django and Static Assets. It seems to be updated recently and you can serve static files nicely using this dj-static package.
command terminal output does not have anything about collecting staticfiles.
Looking at heroku-buildpack-python:bin/steps/collectstatic it seems that it tries to do a collectstatic --dry-run --noinput
and pipes it's output to /dev/null
before displaying the -----> Collecting static files
message. This means that if there is an error there that is not present on your local box, you will never see the error on heroku : it will silently fail. (The best kind of failure ;)
have you tried running a one-off worker to test out the collectstatic command and see if it's a problem in their environment?
heroku run python manage.py collectstatic --dry-run --noinput
If this fails, it will give you an error or traceback to look into and further diagnose the issue.
throwing it out there, since dumb mistakes happen:
I spent much time trying to figure out why my module wasn't found on heroku when it was working fine locally, only to realize it was ignored by an entry into .slugignore
Try these three things:
DJANGO_SETTINGS_MODULE
with a
value of myapp.settings.prod
--or as appropriate for your Heroku settings file git push heroku master
I found I was missing the first item, the DJANGO_SETTINGS_MODULE
" e.g., Command line collectstatic would work but that didn't matter b/c it was an ephemeral dyno