I have a list of sections that I pass to a Django template. The sections have different types. I want to say \"if there is a section of this type, display this line\" in my
You can't use list comprehensions in templates:
{% for s in sections %} {% if s.name == 'Social' %} Hello Social! {% endif %} {# closing if body #} {% endfor %} {# closing for body #}