python django字典值(for循环在.html中不在views.py中)

时间:2017-01-28 08:29:32

标签: python django dictionary

我想打印字典的值。这里的dict在data.entityFeatures

{% for key in data.entityFeatures %}
    <tr>
        <td>{{ key }}</td>
        <td>{{ data.entityFeatures[key] }}</td>
    </tr>
{% endfor %}

我运行此代码时出现以下错误

Could not parse the remainder: '[key]' from 'data.entityFeatures[key]'

0 个答案:

没有答案