I'm new to Django and I'm struggling with this : in my template, I want to iterate on an array defined in my view, add '.png' to the end of each value so I can use them as src value for an <img> tag that I create while iterating. Here's my code :
<table>
<tr>
{% for iter in array %}
{% with 'path/to/images/'|add:iter|add:'.png' as myImg %}
<td><img src="{% static myImg %}" alt=""></td>
{% endwith %}
{% endfor %}
</tr>
</table>
When I print myImg, its value is only '.png', without the iter value.
Maybe I can't use with tag inside a loop ? If so, how can I can concatenate my path, filename and extension ?
Thank's in advance