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
Ideally what you would do is create a list that the template gets as such:
l = [s.name for s in sections]
And in the template, use:
{% if 'Social' in l %}
You're trying to put more logic into a template than they are meant to have. Templates should use as little logic as possible, while the logic should be in the code that fills the template.