Modulus/Modulo equivalent operator/function in django templates?
divisibleby
Returns True if the value is divisible by the argument.
For example:
{{ value|divisibleby:"3" }}
django template doc
forlopp count divisible by 2
{% if forloop.counter|divisibleby:2 == 0 %}
forloop count not divisible by 2
{% if forloop.counter|divisibleby:2 != 0 %}