-1
예와 템플릿의 목록에서 목록을 읽어 목록을 읽어 forloop.counter0 :장고
a_list = ['a', 'b', 'c', 'd']
new_list = [1, 2, 3, 4]
방법 템플릿에 new_list에 값에 액세스 할 수
{% for value in a_list %}
<h2>{{ a_new_list.forloop.counter.0 }}</h2>
{% endfor %}
내가 할 이건 작동하지 않아!
는 https://stackoverflow.com/questions/22358805/django-template-looping-through-two-lists –
'{{a_new_list.forloop.counter0}}'대신'{{a_new_list.forloop를 참조하십시오. counter.0}}' –