1👍
I don’t recommend doing this in Django Template , but in views itself. But if you can’t then you can use {{ forloop|break }}
.
Something like this :
{% for ip in ips %}
{% if d.name == ip.name %}
{{ forloop|break }}
<strong>{{ d.name}} </strong>
{% endif %}
{% endfor %}
Check the small snippet example here…
Source:stackexchange.com