Heroku collectstatic not run during deployment

前端 未结 4 1258
时光取名叫无心
时光取名叫无心 2020-12-19 12:41

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         


        
4条回答
  •  再見小時候
    2020-12-19 13:42

    Try these three things:

    • Create this Heroku config variable: DJANGO_SETTINGS_MODULE with a value of myapp.settings.prod--or as appropriate for your Heroku settings file
    • Use Whitenoise as described in the Heroku docs: https://devcenter.heroku.com/articles/django-assets
    • Check it in and redeploy your dyno: 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

提交回复
热议问题