{% load tree %} {% tree departments|astree:"parent" %} {{ item.id }}: {{ item.name }} {% endtree %}