Python Jinja2找不到json对象属性
我的html文件中有以下代码:Python Jinja2找不到json对象属性,python,html,json,jinja2,Python,Html,Json,Jinja2,我的html文件中有以下代码: <ul style="list-style-type: none;"> {% for project in projects_using_each_technique[loop.index - 1] %} <li><a href="{{ url_for('show_project', id=1) }}"><h3>{{ project }}<
<ul style="list-style-type: none;">
{% for project in projects_using_each_technique[loop.index - 1] %}
<li><a href="{{ url_for('show_project', id=1) }}"><h3>{{ project }}</h3>{{project.short_description}}</a></li>
{% endfor %}
</ul>
还有3个具有相同属性的您可以这样访问
project['short_description']
找到了答案,它是一本字典在一个列表中,这就是为什么它找不到它,现在我总是说它在一个列表中工作。奇怪的是,为什么它以前能工作,因为我得到了我想要的相同结果,现在它已经被修复了,没有我的地址,它在一个列表中。我仍然得到同样的错误,说列表对象没有名为short_description的属性。你能分享你整个打印项目的输出吗?
project['short_description']