for i in range(...) Django |
. , Django :
{% for num in range(1, count_of_pages + 1) %}
<a href="/page{{num}}">{{num}}</a>
{% endfor %}
))). Python . . - { ..., 'my_range': range(1, count_of_pages + 1)}
. my_range
. , , ..:
{% for num in my_range %}
<a href="/page{{num}}">{{num}}</a>
{% endfor %}