Heroku & Django: “OSError: No such file or directory: '/app/{myappname}/static'”

后端 未结 3 1112
生来不讨喜
生来不讨喜 2020-12-23 20:13

I have a Django app on Heroku. I am having some problems with static files (they are loading in one Heroku environment but not another), so I tried the debug command recomme

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-23 21:13

    @joerick's answer above is the thing. However, if you do not want to place another 'static' folder (git root/{your app}/static), you might consider changing the BASE_DIR variable that is initially supplied by django-admin makeproject:

    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    

    which is just the (git root/) directory

提交回复
热议问题