Open evenicoulddoit opened 8 years ago
+1
happy to accept pull requests :) I'm not currently actively working on any django projects and haven't updated anything to 1.9 yet.
I've run into this too. It's coming from the templatetags.jinja_filters, in the import jinja2 line. The part I don't understand is why 1.9 is attempting to load that tag at all. There's either a bug in 1.9, or something very poorly documented.
I believe this is a defect in Django: https://code.djangoproject.com/ticket/26164
This is a backwards-incompatible change in Django 1.9 as described in the release notes: https://github.com/django/django/commit/655f52491505932ef04264de2bce21a03f3a7cd0
In the template tag file you can add something like:
try:
import jinja2
except ImportError:
jinja2 = None
and raise an error later when using the template tag if jinja2 is needed and not installed.
Thanks. Not actually my project, I just thought it illustrated the behavior well. I still disagree this is desirable, but can see the reasons to do it. I do think further documentation is in order on the behavior and how to mitigate unwanted side effects, and would like to propose an exclude_tags template setting that would allow one to block problematic tag loading as needed.
Sent from my iPhone
On Feb 1, 2016, at 5:24 PM, Tim Graham notifications@github.com wrote:
This is a backwards-incompatible change in Django 1.9 as described in the release notes: django/django@655f524
In the template tag file you can add something like:
try: import jinja2 except ImportError: jinja2 = None and raise an error later when using the template tag if jinja2 is needed and not installed.
— Reply to this email directly or view it on GitHub.
Unless
Jinja2
is pip installed, I get the following error on Django 1.9:Didn't have Jinja2 installed previously and was working fine on Django 1.8