I think this can be cleaned up by having libraries and builtins configured
via the `DjangoTemplates` backend. This would build on Mark Tamlyn's idea
in #12772:
{{{
TEMPLATES = [
{
...
'OPTIONS': {
'libraries': {
'admin.urls':
'django.contrib.admin.templatetags.admin_urls',
'my_tags': 'path.to.some.module',
},
'builtins': {
'path.to.builtins_module',
}
},
},
]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24783>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:1>
* status: new => assigned
* owner: nobody => akulakov
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:2>
Comment (by prestontimmons):
Hi akulokov,
I have a PR close to ready on this ticket. Just wanted to let you know
since you assigned yourself, and I forgot to assign myself earlier.
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:3>
Comment (by akulakov):
@preston, no problem, unassigning myself..
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:4>
* owner: akulakov =>
* status: assigned => new
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:5>
* cc: andrei.avk@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:6>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:7>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:8>
Comment (by timgraham):
Should we close #17085 "Deprecate "add_to_builtins" and turn builtins into
a property of Engine" as a duplicate?
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:9>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:10>
* status: new => closed
* owner: => Preston Timmons <prestontimmons@…>
* resolution: => fixed
Comment:
In [changeset:"655f52491505932ef04264de2bce21a03f3a7cd0" 655f5249]:
{{{
#!CommitTicketReference repository=""
revision="655f52491505932ef04264de2bce21a03f3a7cd0"
Fixed #17085, #24783 -- Refactored template library registration.
* Converted the ``libraries`` and ``builtins`` globals of
``django.template.base`` into properties of the Engine class.
* Added a public API for explicit registration of libraries and builtins.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24783#comment:11>