Django staticfiles not found on Heroku (with whitenoise)

后端 未结 8 1406
我在风中等你
我在风中等你 2020-12-01 18:29

This question seems to be asked several time but I can not fix it.

I deployed a django app on production with DEBUG = False. I set my allowed_hos

8条回答
  •  情歌与酒
    2020-12-01 18:50

    I have had the same issue. The simplest way to find the problem is to use

    heroku run ls staticfiles/images
    

    if images is in the directory where your files should be. This will give you a list of all the files in that directory.

    As I found out it was a case issue in the file extension. The file had an extension .JPG and I referenced it on the template with an extension .jpg

提交回复
热议问题