你好,我是django的新手,看了你文章,但是对模板还是有问题。我想在模板(index.html)中实现:
{% i=0 %}
{% for res in result %}
{% i=i+1%}
{%if i>1%}显示i》1{%endif%}
循环的内容
{%endfor%}
.py程序中:
return render_to_response('photo/index.html',{"result":res,"i":0})
报错:
Invalid block tag: 'i'
请问是怎么回事啊 ?
|