As you said, macros do not exist in django programming languages.
There are template tags for creating more complex things in templates, but this is not what you are looking for, since the django template system also does not allow passing parameters to functions.
The best thing for your example would be to use the include tag:
https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#include
This is how I will use it:
templates / snippets / list.html
<ul> {% for item in list %} <li>{{ item }}</li> {% endfor %} </ul>
Templates / index.html
{% include 'snippets/list.html' with list=list1 %} {% include 'snippets/list.html' with list=list2 %} {% include 'snippets/list.html' with list=list3 %} ...
source share