[Django] #24192: Deprecate django.templatetags.static

9 views
Skip to first unread message

Django

unread,
Jan 21, 2015, 4:31:59 AM1/21/15
to django-...@googlegroups.com
#24192: Deprecate django.templatetags.static
--------------------------------------+--------------------
Reporter: doismellburning | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
As far as I can see, since `django.contrib.staticfiles` was merged in,
there's no reason to use `django.templatetags.static` and plenty of
reasons not to (e.g. it makes assumptions about the existence of
`STATIC_URL`)

The fact it provides a tag of the same name as the "correct" tag from
`staticfiles` doesn't help either.

Could it be deprecated?

(And if I wanted to follow up with an accompanying PR, should I be using
`RemovedIn110Warning` or `RemovedIn20Warning` (the latter of which has
several instances, but surprises me slightly)

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

Django

unread,
Jan 21, 2015, 4:32:52 AM1/21/15
to django-...@googlegroups.com
#24192: Deprecate django.templatetags.static
-------------------------------------+-------------------------------------
Reporter: doismellburning | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by doismellburning):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Ok, `RemovedIn20Warning`, thanks apollo13

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

Django

unread,
Jan 21, 2015, 4:53:55 AM1/21/15
to django-...@googlegroups.com
#24192: Deprecate django.templatetags.static
-------------------------------------+-------------------------------------
Reporter: doismellburning | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
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 doismellburning):

Ah, I've just noticed this is used by admin; this PR is getting more fun!

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

Django

unread,
Jan 21, 2015, 5:01:01 AM1/21/15
to django-...@googlegroups.com
#24192: Deprecate django.templatetags.static
-------------------------------------+-------------------------------------
Reporter: doismellburning | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
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 doismellburning):

So `django.contrib.admin.templatetags.admin_static` tries to use
`django.contrib.staticfiles.templatetags.staticfiles` if the app's there,
otherwise falls back to `django.templatetags.static`.

Can anyone provide guidance as to "improved" behaviour there please? Is
there any kind of policy against apps from contrib depending on one
another? Is it reasonable for `d.c.admin` to assume/require
`d.c.staticfiles`? If the latter, can anyone point me to an existing
example so I can crib from its mechanisms please?

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

Django

unread,
Jan 21, 2015, 5:18:27 AM1/21/15
to django-...@googlegroups.com
#24192: Deprecate django.templatetags.static
-------------------------------------+-------------------------------------
Reporter: doismellburning | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by jwa):

* cc: julian@… (added)


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

Django

unread,
Jan 22, 2015, 8:24:15 PM1/22/15
to django-...@googlegroups.com
#24192: Deprecate django.templatetags.static
-------------------------------------+-------------------------------------
Reporter: doismellburning | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Core (Other) | Version: master
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
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => wontfix
* component: Uncategorized => Core (Other)


Comment:

I don't see much advantage here vs. the pain this is likely to cause
(force everyone to use `contrib.staticfiles` and `{% load static %}` in
their templates. The documentation points users in the direction IMO.
There has been some talk of "if we did it again, static files might have
been better in core, rather than contrib", but I'm not sure if that's
something that's worth changing at this point. See also #18942. Feel free
to raise the issue on the DevelopersMailingList or reopen if you think
I've missed something here.

--
Ticket URL: <https://code.djangoproject.com/ticket/24192#comment:5>

Reply all
Reply to author
Forward
0 new messages