niwinz / django-jinja

Simple and nonobstructive jinja2 integration with Django.
http://niwinz.github.io/django-jinja/latest/
BSD 3-Clause "New" or "Revised" License
361 stars 102 forks source link

Template engine is recognized as 'backend' instead of Jinja2 #151

Closed glogiotatidis closed 8 years ago

glogiotatidis commented 8 years ago
>>> from django.template import engines
>>> engines.all()
[<django_jinja.backend.Jinja2 object at 0x7f4d27a60410>, <django.template.backends.django.DjangoTemplates object at 0x7f4d27a654d0>]
>>> engines.all()[0].name
'backend'
>>> 
douglas commented 8 years ago

Also, it seems to break django-debug-toolbar:

https://github.com/django-debug-toolbar/django-debug-toolbar/issues/790

@niwinz, what is the best way to fix it ? In django-jinja or in django-debug-toolbar ?

Thanks =)

niwinz commented 8 years ago

About the first one, you should pass "NAME": "jinja2" if you want an other name. The django-jinja backend does the same thing that the jinja2 native backend of django.

And

I don't know that problem do you have with django debug toolbar and django-jinja. I'm using them both in few projects and everything works as expected (with exception to "templates" tab that shows nothing because django debug tool bar only works with django template engine.

niwinz commented 8 years ago

I have used ddt 1.3, but it seems that 1.4 introduces some changes that breaks compatibility. This seems ddj toolbar issue because 1.3 works perfectly with django-jinja

niwinz commented 8 years ago

I have fixed the compatibility with ddt 1.4 in #157

niwinz commented 8 years ago

Now 2.1.0 is released and it should work properly with django-debug-toolbar.

IlyaSemenov commented 8 years ago

The django-jinja backend does the same thing that the jinja2 native backend of django.

@niwinz no, it doesn't. The native backend django.template.backends.jinja2.Jinja2 is put into ENGINES['jinja2'] (as it takes the containing module name for the key).