Django 1.2 introduced support for non-Django template systems. Unfortunately the instrumented test renderer is still Django specific. This branch updates the Template panel monkey patching to wrap template lookup and decorate the Template class' render method to emit the correct signal. This allows DjDT to work with non-Django template systems (tested with Mako templates).
Non-Djano templates may not have a name or origin property.
Replace find_template with a version that decorates Template classes.
find_template_and_decorate will decorate the render method of Template
classes in order to emit signals needed by Django Debug Toolbar.
I want it too
This code has been refactored since you filed the pull request. Do you know if the problem still exists in master?
After further code inspection, I believe the master branch doesn't support this use case yet.
https://github.com/jbalogh/jingo should allow to reproduce this issue without writing too much code.
I spent some time on this issue today. Django's support for other template languages is documented here:
The debug toolbar performs two monkey-patches:
Some libraries designed to integrate third-party template languages with Django have these features built-in:
If we look at the implementation, Django goes through through each template loader and calls it with the template name. The template object is returned by load_template. We can override that method. However, at this point, the template is already initialized. All we can do is alter the behavior of its render method.
Jinjo now supports working with the debug toolbar. I found another library that I was able to reproduce the issue with, django-jinja2.
Also, for future/other readers the issue isn't that an error occurs, it's that the template panel doesn't contain any information about the template or the context passed to it.
I'm going to close this in favor of #693. Sorry it didn't get merged.