在后端代码中,我们如果遍历字典,需要用 for key,value in data.items(): ... 如果我们在views给前端传送了一个字典,前端需要这样遍历 {% for key,value in data.items %} ... {% endfor %}