Open ae99 opened 9 months ago
That's surprising! We should definitely add some Jinja2-only syntax to the basic.jinja
template.
I did some work here https://github.com/jazzband/django-debug-toolbar/pull/1882 but yeah, it seems that the tracking is broken. I wonder when that happened!
Hey! Spent some time trying to get Jinja2 templates to appear in the debug toolbar correctly. Templates tab was simply saying "No Templates". This had me stumped as there's a test case for this in the codebase.
Upon some further digging, I think the Jinja2 test in
tests/templates/jinja2/basic.jinja
is actually being rendered as a Django template, not through Jinja 2. Modifying that template to contain:Causes the test to fail with Django throwing
django.template.exceptions.TemplateSyntaxError
- even though this is valid Jinja and Django's template shouldn't be involved, so this test isn't actually using Jinja2.It appears if you are using Jinja2 to render templates, DDT isn't able to pick up what goes on inside them, at least with default configurations. Any pointers on how I could get this working for myself would be great!