I followed this answer.
Iterate through a static image folder in django
But I'm not sure why it's giving me the following error
django.template.exceptions.TemplateSyntaxError: Invalid filter: 'file'
I have
{% with 'images/'|file as image_static %}
<img src="{% static image_static %}" alt="">
<a class="gallery-one__link img-popup" href="{% static image_static %}"><i class="tripo-icon-plus-symbol"></i></a>
{% endwith %}
I did pass the context dict correctly in views, I think, because I saw this in my traceback:
context_dict = {}
files = os.listdir(os.path.join(settings.STATIC_ROOT, "blog/images/gallery"))
context_dict['files'] = files
I also tried {% load crispy_forms_filters %}
at the start of the HTML but it's not making a difference. I'm quite new to this, so I'm probably doing something stupid, and I cannot find any docs referring to this specific instance