OK, first let me start by saying I tried to live with the django template 
processor.  But I need more power.  I like jinja2's macros - much slicker than 
having to write a custom tag.

So I've downloaded jinja2 and installed it.  Good.

After trying a couple of integration recipes on the web that "almost but not 
quite worked" I've found and downloaded chouwa and started using that.  This 
works.  Good.

I have templates I want to inherit from that were written for the default 
template processor that use tags with names like 'url'.  Amazingly, jinja2 
lacks this and a few other commonly used tags.  So I'm looking for 
compatibility extensions.

I found: http://www.djangosnippets.org/snippets/1062/

Which looks like it might solve my problem - if I could get it recognized by 
jinja2's initialization.  I've copied this code to a file at the root level of 
myapp called tags.py

I've added the following to my settings.py file

JINJA_EXTS = (
    'jinja2.ext.i18n',
    'jinja2.ext.do',
    'jinja2.ext.loopcontrols',
    'from myapp.tags import *',
)


JINJA2_ENVIRONMENT_OPTIONS = {
    'extensions': JINJA_EXTS,
}

I've tried half a dozen incantations trying to get these functions imported as 
extensions to jinja2 and nothing seems to work.  I've tried
'myapp.tags'
'myapp.tags.url' (this one produces a scary error 'no patterns in myapp.urls' 
and the entire app dies)

and a few others.  I'm stuck.  What's the trick to getting compatibility tags 
for django installed into jinja2?

-Todd Blanchard

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to