1

Is it possible to do like this in django templates?

{% for filename in filenames %}
    {% include filename+".html" %}
{% endfor %}   

As you see I have a list of filenames and I want to include all of them using for loop. And second question: if filename is an integer can I convert to string? Like this:

{% for filename in filenames %}
    {% include str(filename)+".html" %}
{% endfor %}
Heri
  • 4,368
  • 1
  • 31
  • 51
Martian
  • 99
  • 1
  • 11

0 Answers0