[Django]-Django-pipeline throwing ValueError: the file could not be found

9👍

Your problem is related to this bug on the Django project.

In short, django-pipeline is post-processing the url() calls with Django’s CachedStaticFilesStorage to append the md5 checksum to the filename (more details here) and doesn’t detect when it is inside a comment.

If you look on the header of the jquery-ui.css (and similar) files there is a comment that starts with

  • To view and modify this theme, visit […]

Inside the URL on this line there is a parameter that is being interpreted as an url() call and generating the error you see.

To work around this issue you can simply remove the above line from jquery-ui.css and collectstatic should work properly.

3👍

You can use the flag --no-post-process:

manage.py collectstatic --no-post-process

0👍

This error is caused when you are trying to point to a static file which is invalid in your CSS property:

body {
   background-image: url(path/to/image/invalid_image.jpg);
}

Therefore all you need to do to get the error disappear for good is to ensure that you are pointing to the correct static file path.

More info?
what happens in the background of this code block is that the url property expects a valid parameter which when it does find return None thus raising the exception because it can’t store a None type value in the static file storage that you set in your django settings file.

Leave a comment