How to catch missing referenced files in Django static files manifest
I recently had a deployment fail with the following WhiteNoise error. -----> $ python src/manage.py collectstatic --noinput Post-processing 'polls/style.css' failed! whitenoise.storage.MissingFileError: The file 'polls/style.css.map' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f5c4b1970e0>. The CSS file 'polls/style.css' references a file which could not be found: polls/style.css.map Please check the URL references in this CSS file, particularly any relative paths which might be pointing to the wrong location. It was easy enough to fix, by adding the missing style.css.map file, but I wanted to write a test that would help prevent this from happening again in the future. Here’s what I started with. ...