Django heroku static dir

后端 未结 3 1406
情话喂你
情话喂你 2021-01-31 05:43

I\'m new to heroku and I tried a simple django app without css.

But I just added a css file in my app and when i do this:

git push heroku master
         


        
3条回答
  •  迷失自我
    2021-01-31 06:07

    You're on your way. What's happening is that Heroku is trying to use your STATICFILES_DIRS setting (/home/kevin/web/django/appheroku/blogapp/static) that exists locally on your machine but won't doesn't exist on the Heroku server.

    A simple solution is to remove that line from the staticfiles_dir variable so you have:

    STATICFILES_DIRS = ()
    

    Then your default STATICFILES_FINDERS will kick in and you should be good to go to run your app both locally as well as deployed on Heroku.

提交回复
热议问题