Is there a Django template language equivalent to the Pythons () range?

Possible duplicate:
Figures for a loop in Django templates

In Python, if I want to run a loop nine times, I can do:

for i in range(1,10):

Is there a tag equivalent {% for %}in the Djangos template language?

+3
source share
1 answer

See this question.

Basically, there is no support for it directly, and you will need to write your own template tag or add it to the context yourself. In any case, this is not a big deal.

+4
source

Source: https://habr.com/ru/post/1783692/


All Articles