django template add numbers
{% with total=0 %}
{% for number in numbers %}
{% if number %}
{% with total=total|add:number %}
{% endwith %}
{% endif %}
{% endfor %}
{% endwith %}
Total: {{ total }}
{% with total=0 %}
{% for number in numbers %}
{% if number %}
{% with total=total|add:number %}
{% endwith %}
{% endif %}
{% endfor %}
{% endwith %}
Total: {{ total }}