I'd like to use Jinja2 with a Django project. I'm using this template loader from Django Snippets, but I still need to be able to render templates with Django for the admin pages. Whenever I try to use the admin pages, though, I get a TemplateSyntaxError because of the unknown tag "load". Is there a way to make the Jinja template loader defer to Django's built-in system when it can't handle the template?
1 Answers
4
votes
I would recommend using this fork of Coffin when using Jinja and Django templates at the same time: https://github.com/GaretJax/coffin/blame/master/README.rst I implemented this on http://umbel.com/ which uses a combination of Django and Jinja templates.
It has a setting that you can use to disable Jinja's template loader for specific apps:
JINJA2_DISABLED_APPS = (
'admin',
'auth',
)
Hope that helps you out.