django-debug-toolbar icon indicating copy to clipboard operation
django-debug-toolbar copied to clipboard

Support for multiple template engines

Open aaugustin opened this issue 10 years ago • 5 comments

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.

aaugustin avatar Mar 02 '15 21:03 aaugustin

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

tim-schilling avatar May 11 '15 23:05 tim-schilling

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.

aaugustin avatar May 12 '15 10:05 aaugustin

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 avatar May 15 '15 16:05 nex2hex

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

nex2hex avatar May 15 '15 16:05 nex2hex

@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.

aaugustin avatar May 17 '15 07:05 aaugustin