Opened 4 years ago

Last modified 4 years ago

#23563 new Cleanup/optimization

Make `staticfiles_storage` a public API

Reported by: Aymeric Augustin Owned by: nobody
Component: Documentation Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is a follow-up ticket to #23506, focused on the part of the problem I believe we need to solve.

Django should provide a way to obtain the URL of static files other than the {% static %} template tag. I haven't found one in the docs.

I think the easiest solution is to make django.contrib.staticfiles.storage.staticfiles_storage a public API and document that it implements the file storage API, especially the url method.

Change History (1)

comment:1 Changed 4 years ago by Tim Graham

Component: contrib.staticfilesDocumentation
Needs documentation: unset
Triage Stage: UnreviewedAccepted

For this it would be helpful to point to docs/howto/custom-file-storage.txt which lists the usual methods for storage classes. For example, staticfiles_storage.url('foo.js') works to get URL.

Note: See TracTickets for help on using tickets.
Back to Top