#31447: ManifestStaticFilesStorage should have file exclude patterns.
-------------------------------------+-------------------------------------
Reporter: Carsten Fuchs | Owner: nobody
Type: New feature | Status: closed
Component: contrib.staticfiles | Version: 3.0
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by felixxm):
Replying to [comment:2 Carsten Fuchs]:
> Hello Felix,
>
> sorry, my description was probably not clear:
> When we use `ManifestStaticFilesStorage`, the `collectstatic` command
copies and creates static files such that the result is, for example:
> {{{
> usermanual.4b127df11c35.pdf
> usermanual.pdf
> }}}
> In a template, using `{% static 'usermanual.pdf' %}`, links to
`.../static/usermanual.4b127df11c35.pdf` are generated. What I intended
with the above suggested `STATICFILES_MANIFEST_EXCLUDES` setting is to
have only
> {{{
> usermanual.pdf
> }}}
> copied and `{% static 'usermanual.pdf' %}` generating a link to
`.../static/usermanual.pdf`, just as if not the manifest, but the default
`StaticFilesStorage` was used. (For all files not covered by
`STATICFILES_MANIFEST_EXCLUDES`, the hashed paths should be used.)
>
> In contrast to that, `collectstatic --ignore` doesn't copy the ignored
files at all, causing `{% static 'usermanual.pdf' %}` to raise an
exception.
You should be able to [https://docs.djangoproject.com/en/3.0/howto/custom-
file-storage/#writing-a-custom-storage-system write a custom] subclass of
[https://docs.djangoproject.com/en/3.0/ref/contrib/staticfiles/#manifeststaticfilesstorage
ManifestStaticFilesStorage] for this. We don't want to provide settings
for customizing the `ManifestStaticFilesStorage` behavior.
--
Ticket URL: <https://code.djangoproject.com/ticket/31447#comment:3>
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/066.ddbf854bb90c7ef226181c5ea1fa70dd%40djangoproject.com.