{% recursetree categories %}
<!-- блок аккордеон -->
<div class="accordion">
<section class="accordion_item">
<h3 class="title_block"><strong>{{ node.name }}</strong></h3>
{% if not node.is_leaf_node %}
{% for child in node.children.all %}
<div class="info"><hr>
<ul>
<li class="info_item"><a href="{% url 'shop:catlist' child.slug %}"><u>{{ child.name }}</u></a></li>
</ul>
{% recursetree child.children.all %}
<ul>
<li class="info"><a href="{% url 'shop:shop-list' node.slug %}">{{ node.name }}</a></li>
</ul>
{% endrecursetree %}
</div>
{% endfor %}
{% endif %}
</section>
</div>
<!-- конец блока аккордеон -->
{% endrecursetree %}