I need to alternate in the template class container div
{% for smth in smth_list %} {% if (forloop.counter % 2 != 0) %} <!-- Ошибка в этом месте --> <div class="container container-1"> {{ smth }} </div> {% else %} <div class="container container-2"> {{ smth }} </div> {% endif %} {% endfor %}
This code gives an error:
Could not parse the remainder: '(forloop.counter' from '(forloop.counter'