#26164: Django 1.9: All template tags are loaded, whether desired or not
---------------------------------+--------------------
Reporter: tBaxter | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
In Django 1.9, anything in /app/templatetags/ appears to be loaded,
whether they are loaded into a template or not, desired, or even suited to
the current environment.
To reproduce:
1. Start a fresh Django 1.9 project
2. pip install typogrify
3. Create a TemplateView URL, and in the template, simply have "Hello
world", with no blocks, no template loading, no nothing.
You will see "ImportError raised when trying to load
'typogrify.templatetags.jinja_filters': No module named jinja2"
Because jinja2 was never pip installed, of course. But Django is loading
https://github.com/mintchaos/typogrify/blob/master/typogrify/templatetags/jinja_filters.py
anyway.
I don't think an unwanted third-party app should be able to control the
environment. If this *is* actually desired or necessary, whether it makes
sense to me or not, I think some guidance for template tag writers and
site owners to mitigate downsides is in order
Reference: https://github.com/mintchaos/typogrify/issues/44
--
Ticket URL: <https://code.djangoproject.com/ticket/26164>
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/050.667fad1886b0cc949740d87c2e38f701%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.