[Fixed]-How to use forloop counter within curly braces in django?

1👍

you do not need inner {{...}} brackets – Django is parsing variables in outer brackets already.

Also if you need to concatenate two values you need to use add filter

Then it should be:

    {% for me in obj %}
        {{ me|add:forloop.counter }}
    {% endfor %}

Leave a comment