Django heroku static dir

后端 未结 3 1410
情话喂你
情话喂你 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 05:59

    For anyone who's coming in like me:

    Like @eliotk implies,

    PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
    STATIC_ROOT= os.path.join(PROJECT_DIR,'staticfiles/')
    STATICFILES_DIRS = ()
    

    This is the config you want to avoid FileNotFoundError: [Errno 2] No such file or directory: errors or OSError: [Errno 30] Read-only file system: errors.

提交回复
热议问题