#24783: Template libraries and built-ins should be registered through the engine
---------------------------------+--------------------
     Reporter:  prestontimmons   |      Owner:  nobody
         Type:  New feature      |     Status:  new
    Component:  Template system  |    Version:  master
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 Django template libraries and builtins depend on global variables in
 `django.template.base`. This is messy, but also restrictive. The only way
 to specify template tag modules is by adding a package in `INSTALLED_APPS`
 that has a `templatetags` directory. Modifying `builtins` is a hack. And
 the `LoadNode` has a hard dependency on `django.apps`. Preferably,
 libraries and builtins should be specified and live on the `Engine`
 instance instead.

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.f069bbe730bb4f6b9b94fd3455bd8b3f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to