This is (or at least, was) impossible in Django template system,
because the includes are performed before block (i.e. {% for ... %} or
{% if ... %}) manipulation. When you do as you wrote, Django executes
infinite recursion. Therefore, it crashes.
Anyway, you still have several solutions to tha
I've a template which will be included. Within the template I want to
include it again if needed.
child_list.html
{% if categorie %}
{{ categorie.title }}
{% if categorie.child_set.all %}
{% for categorie in categorie.child_set.all %}
{% include "child_list.html" %}
2 matches
Mail list logo