[Django] #23563: Make `staticfiles_storage` a public API

7 views
Skip to first unread message

Django

unread,
Sep 28, 2014, 5:33:21 AM9/28/14
to django-...@googlegroups.com
#23563: Make `staticfiles_storage` a public API
------------------------------------------------+------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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
[https://docs.djangoproject.com/en/1.7/ref/files/storage/#django.core.files.storage.Storage.url
url] method.

--
Ticket URL: <https://code.djangoproject.com/ticket/23563>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 1, 2014, 10:15:47 AM10/1/14
to django-...@googlegroups.com
#23563: Make `staticfiles_storage` a public API
--------------------------------------+------------------------------------

Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* needs_docs: 1 => 0
* component: contrib.staticfiles => Documentation
* stage: Unreviewed => Accepted


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/23563#comment:1>

Django

unread,
Jun 16, 2022, 7:28:57 AM6/16/22
to django-...@googlegroups.com
#23563: Make `staticfiles_storage` a public API
--------------------------------------+------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/23563#comment:2>

Django

unread,
Jun 24, 2022, 4:24:34 PM6/24/22
to django-...@googlegroups.com
#23563: Make `staticfiles_storage` a public API
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Pablo
Type: | Montepagano
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Pablo Montepagano):

* owner: nobody => Pablo Montepagano
* status: new => assigned


Comment:

I don't believe there's much improvement to be made here. In the section
"Other Helpers" of `docs/ref/contrib/staticfiles.txt` we already have this
sentence:

The builtin template tag `static` which takes a path and urljoins it
with the static prefix `STATIC_URL`. If `django.contrib.staticfiles` is
installed, the tag uses the `url()` method of the `STATICFILES_STORAGE`
instead.

--
Ticket URL: <https://code.djangoproject.com/ticket/23563#comment:3>

Django

unread,
Jan 25, 2023, 2:53:51 AM1/25/23
to django-...@googlegroups.com
#23563: Make `staticfiles_storage` a public API
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Pablo
Type: | Montepagano
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => fixed


Comment:

Replying to [comment:3 Pablo Montepagano]:


> I don't believe there's much improvement to be made here. In the section
"Other Helpers" of `docs/ref/contrib/staticfiles.txt` we already have this
sentence:
>
> The builtin template tag `static` which takes a path and urljoins it
with the static prefix `STATIC_URL`. If `django.contrib.staticfiles` is
installed, the tag uses the `url()` method of the `STATICFILES_STORAGE`
instead.

Agreed, this has already been documented in
cf546e11ac76c8dec527e39ff8ce8249a195ab42.

--
Ticket URL: <https://code.djangoproject.com/ticket/23563#comment:4>

Reply all
Reply to author
Forward
0 new messages