Why does this not work in Django?
{% for img in image_list %}
{% if img != image_list[-1] %}
<img src="{% get_media_prefix %}{{ img.image }}" class="img-fluid rounded" alt="Recipe Image Secondary">
<br>
{% endif %}
{% endfor %}
Simple Python (works):
for img in image_list:
if img != (image_list[-1]):
print(img)
{% if img != image_list[-1] %}
throws a TemplateSyntaxError Could not parse the remainder: '[-1]' from 'image_list[-1]'