#32218: storage.StaticFilesStorage.post_process substitutes relative URLs in
comments
-------------------------------------+-------------------------------------
Reporter: Gagan | Owner: Gagan Deep
Deep |
Type: Bug | Status: assigned
Component: | Version: master
contrib.staticfiles |
Severity: Normal | Keywords: static
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
While using {{{ STATICFILES_STORAGE =
'django.contrib.staticfiles.storage.ManifestStaticFilesStorage' }}}
setting, the {{{ collectstatic }}} command was always failing because it
was not able to find a certain file. I am getting the following error:
{{{
ValueError: The file 'netjsongraph/css/lib/"images/ui-
icons_555555_256x240.png"' could not be found with
<django.contrib.staticfiles.storage.ManifestStaticFilesStorage object at
0x7f773b3be520>.
}}}
The peculiar thing to notice is the name of the missing file contains {{{
" }}}. Initially I thought it might me an error in the CSS, but even after
removing all CSS properties using {{{ url() }}} functions, the error was
still there.
The error disappeared only after I removed the comment in the CSS file
which contained {{{ url(%22images%2Fui-icons_555555_256x240.png%22) }}} as
a parameter to some URL.
The {{{ post_process }}} should not try to make substitutions for {{{ url
}}} keyword inside comments. Since it pattern matching is used to make
substitutions, it will be better to process files without comments for
pattern matching.
You can use [https://github.com/openwisp/openwisp-network-
topology/blob/485a97bcc273fc4dfbb53f509f70a4825fab5a0f/openwisp_network_topology/static/netjsongraph/css/lib
/jquery-ui.min.css this CSS file] for reproducing this bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/32218>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.0a9d7359dfd3a12b8d93fc0d65eb5e9f%40djangoproject.com.