Django常用模板标签

a.for 标签,用来循环显示列表各项的值,比如要显示wordpress文章列表:

{% for post in posts %} 
<div>
<h2><a href=”{{ post.guid }}”>{{ post.title }}</a></h2>
{{ post.content }}
</div>
{% endfor  %}

(阅读全文)


原文地址:https://www.cnblogs.com/lloydsheng/p/1764106.html