addition inside html


I am passing a variable i to an html page. I need to make math operation with the variable say like i += 1 in a loop:

{% for order in order_list %}
    {% if order.transaction_id %}
        <a href="{% url 'detailed-transactions' %}"> رقم المعاملة **{{ i += 1 }}** : {{ order.transaction_id }} </a>
    {% endif %}
{% endfor %}

You don’t do math in a template.

If you need an index within the loop, see the variables available to you in the documentation for the for tag.