Article From:https://www.cnblogs.com/zhangdewang/p/9216231.html

Getting the dictionary value in the HTML template of Django should use the dictionary.[key] directly.

 

{% for i in lists  %}
<li id="{{i.id}}" class = "db_data">
<h2>{{i.question}}</h2>
<h3>{{i.answer}}</h3>
<h3>{{i.explain}}</h3>
</li>

 

Leave a Reply

Your email address will not be published. Required fields are marked *