I have this code
{% for account in object_list %}
<tr>
{% for field, value in book.get_fields %}
<th>{{ field.verbose_name }}</th>
{% endfor %}
</tr>
{{ break }}
{% endfor %}
I want to break the for loop after first iteration. break is not working
There is no
breakin Django template system. Django template system is not programmed with python but with its own language.Depending on what you need to do, you might find this question useful. Otherwise, just put the one and only account you are trying to print on HTML on a special field on your
RequestContext.