question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WhiteNoise fails on missing file (that's there)

See original GitHub issue

When 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:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evansdcommented, Feb 27, 2017

@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 create bin/post_compile script to do this. There are some examples here: https://github.com/nigma/heroku-django-cookbook/tree/master/bin

Hope that helps.

0reactions
FahimAhamed101commented, Apr 25, 2022

move installed apps like this
‘django.contrib.staticfiles’, ‘ckeditor’, ‘ckeditor_uploader’, i hope it will solve the problem

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found