WhiteNoise fails on missing file (that's there)
See original GitHub issueWhen I enable WhiteNoise locally (added middleware, and STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
) but when I run collectstatic
I get the error that The CSS file 'css/business-casual.css' references a file which could not be found: staticfiles/img/clouds.jpg
. The file is definitely there (my css has a relative path to its storage spot in my staticfiles directory… I’m pretty sure I did it right). Removing the staticfiles_storage fixes it locally although I’m still having trouble deploying it to heroku. Not sure if the errors are related or not
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
'collectstatic' command fails when WhiteNoise is enabled
There are two ways to resolve this: Switch to using CompressedStaticFilesStorage (no Manifest ), so that file hashes are not pre-rendered.
Read more >collectstatic fails because whitenoise cannot find files in ...
I am trying to deploy my django project to heroku and am attempting to run collectstatic so that whitenoise is able to serve...
Read more >Using WhiteNoise with Django
Enable WhiteNoise Edit your settings.py file and add WhiteNoise to the MIDDLEWARE list. The WhiteNoise middleware should be placed directly after the Django ......
Read more >Static Files in Django - Dan's Cheat Sheets's documentation!
No! The browser will only know where to get those static files based on URLs that ... whitenoise provides a couple of alternative...
Read more >21080 (collectstatic post-processing fails for references inside ...
Ideally, collectstatic should respect CSS comments and should not attempt to parse/reference files in lines that are commented out.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@paulnicholsen27 I’ve had a look, but I’m not familiar enough with django-compress to work out what’s going on.
The only thing I think of though is to double-check that
./manage.py compress
is being run when you push to Heroku. You’ll need to createbin/post_compile
script to do this. There are some examples here: https://github.com/nigma/heroku-django-cookbook/tree/master/binHope that helps.
move installed apps like this
‘django.contrib.staticfiles’, ‘ckeditor’, ‘ckeditor_uploader’, i hope it will solve the problem