[Django] #24235: Deprecate is_usable attribute on template loaders?

7 views
Skip to first unread message

Django

unread,
Jan 27, 2015, 10:41:47 PM1/27/15
to django-...@googlegroups.com
#24235: Deprecate is_usable attribute on template loaders?
---------------------------------+--------------------
Reporter: prestontimmons | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
Each Django loaders has a boolean attribute of "is_usable". It seems the
only use for this comes from the egg loader when setuptools isn't
installed. If "is_usable" is false, a warning is raised in
engine.find_template_loader, but otherwise the loader is silently ignored
for template loading.

It seems like that is the wrong behavior. I think the loaders should fail
loudly if they're missing configuration. Otherwise, it's unclear why
they're not used to find templates. I ran into this when writing a sample
loader and forgetting to specify "is_usable" as True on it.

Unless there's a use case for silently ignoring template loaders, I think
we should deprecate this behavior.

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

Django

unread,
Jan 28, 2015, 2:36:49 AM1/28/15
to django-...@googlegroups.com
#24235: Deprecate is_usable attribute on template loaders?
--------------------------------------+------------------------------------
Reporter: prestontimmons | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Template system | Version: master
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 aaugustin):

* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

Yes.

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

Django

unread,
Feb 3, 2015, 5:39:00 PM2/3/15
to django-...@googlegroups.com
#24235: Deprecate is_usable attribute on template loaders?
--------------------------------------+------------------------------------
Reporter: prestontimmons | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Template system | Version: master
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
--------------------------------------+------------------------------------

Comment (by prestontimmons):

I added a pull request here:

https://github.com/django/django/pull/4046

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

Django

unread,
Feb 3, 2015, 5:48:23 PM2/3/15
to django-...@googlegroups.com
#24235: Deprecate is_usable attribute on template loaders?
--------------------------------------+------------------------------------
Reporter: prestontimmons | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Template system | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* has_patch: 0 => 1


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

Django

unread,
Feb 4, 2015, 7:48:37 AM2/4/15
to django-...@googlegroups.com
#24235: Deprecate is_usable attribute on template loaders?
--------------------------------------+------------------------------------
Reporter: prestontimmons | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Template system | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"5bc5ddd8b5d787c5e744efead184d46c55d03687"]:
{{{
#!CommitTicketReference repository=""
revision="5bc5ddd8b5d787c5e744efead184d46c55d03687"
Fixed #24235 -- Removed is_usable attribute from template loaders.
}}}

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

Django

unread,
Sep 5, 2015, 10:59:22 AM9/5/15
to django-...@googlegroups.com
#24235: Deprecate is_usable attribute on template loaders?
--------------------------------------+------------------------------------
Reporter: prestontimmons | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Template system | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"5528e7da1a790aae8f6e0fd61ebccb2b87cbd97a" 5528e7d]:
{{{
#!CommitTicketReference repository=""
revision="5528e7da1a790aae8f6e0fd61ebccb2b87cbd97a"
Refs #24235 -- Removed unused is_usable attribute from base template
Loader.
}}}

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

Reply all
Reply to author
Forward
0 new messages