Sunday, March 29, 2015

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

Hi Rolf,

Did you install jinja2 in your python environment (I assumed /www/pbs-venv was a virtualenv)?

What does /www/pbs-venv/bin/pip --freeze outputs?

Simon

Le dimanche 29 mars 2015 14:53:49 UTC-4, Rolf Brudeseth a écrit :

Rename your jinja2.py file something else and things should be working.

 
I am having some problems wrapping my head around how to implement this.

When I rename the file I created to something arbitrary I get:

Exception Value:
No module named 'jinja2'
Exception Location: /www/pbs-venv/lib/python3.4/site-packages/django/template/backends/jinja2.py in <module>, line 6

Not sure why the file above has this statement on line 6 if it is not to reference the file I created:
import jinja2

Furthermore, this file does not have an 'Environment' class so I am not sure how the following statement will work in the file I am supposed to create:
from jinja2 import Environment

Finally, I am not sure how to reference the file I need to create. Is that specified in settings.py?

Thanks
 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/62d0327a-b639-4a9c-b202-7f367bcd01d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment