Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jinja2 required for Django 1.9 #44

Open
evenicoulddoit opened this issue Jan 5, 2016 · 6 comments
Open

Jinja2 required for Django 1.9 #44

evenicoulddoit opened this issue Jan 5, 2016 · 6 comments

Comments

@evenicoulddoit
Copy link

Unless Jinja2 is pip installed, I get the following error on Django 1.9:

django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'typogrify.templatetags.jinja_filters': No module named jinja2

Didn't have Jinja2 installed previously and was working fine on Django 1.8

@davejacobs
Copy link

+1

@chrisdrackett
Copy link
Collaborator

happy to accept pull requests :) I'm not currently actively working on any django projects and haven't updated anything to 1.9 yet.

@tBaxter
Copy link

tBaxter commented Jan 28, 2016

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.

@tBaxter
Copy link

tBaxter commented Feb 1, 2016

I believe this is a defect in Django: https://code.djangoproject.com/ticket/26164

@timgraham
Copy link

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.

@tBaxter
Copy link

tBaxter commented Feb 2, 2016

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 [email protected] 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants