You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
{% extends 'base.html' %}
{% block content %}Test for {{ title }} (Jinja)
{% for i in range(10) %}{{ i }}{% endfor %}
{% endblock %}
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: