jazzband / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
8.05k stars 1.04k forks source link

Support for multiple template engines #693

Open aaugustin opened 9 years ago

aaugustin commented 9 years ago

It would be nice to provide something in the templates panel when another engine is used in Django ≥ 1.8. Current efforts by @prestontimmons to formalize the loader API may help.

tim-schilling commented 9 years ago

@aaugustin Can we close this with #711 being merged?

aaugustin commented 9 years ago

Not really.

771 is a stop-gap fix to prevent an exception when using Jinja2.

This ticket is about taking advantage of the new debug APIs that have been committed recently and will be available in Django 1.9.

nex2hex commented 9 years ago

Example solution:

return render_to_string('debug_toolbar/base.html', context)

change to something like this:

return render_to_string('debug_toolbar/base.html', context, using=self.config['TEMPLATE_ENGINE_ALIAS'])
nex2hex commented 9 years ago

and pull request for this https://github.com/django-debug-toolbar/django-debug-toolbar/pull/713

aaugustin commented 9 years ago

@nex2hex The goal of this issue is to allow the toolbar to report complete debug information about templates regardless of which engine was used to render them.

The using keyword argument is only intended for low-level control of rendering engines. It would be harmful to use it here because it would prevent Django's automatic template selection mechanism to kick in.