Google app engine jinja2模板值的语法无效
为什么max\u height会产生无效的语法错误 main.pyGoogle app engine jinja2模板值的语法无效,google-app-engine,python-2.7,jinja2,Google App Engine,Python 2.7,Jinja2,为什么max\u height会产生无效的语法错误 main.py max_height = 70 template_values = { 'max_height': max_height # syntax error ... } index.html <html> <body> {% for person in people %} {% if person.filter("heigh
max_height = 70
template_values = {
'max_height': max_height # syntax error
...
}
index.html
<html>
<body>
{% for person in people %}
{% if person.filter("height <", max_height %)
<b>{{ person.first_name }}</b>
<b>{{ person.last_name }}</b>
<b>{{ person.city }}</b>
<b>{{ person.birth_year }}</b>
<b>{{ person.height }}</b>
<hr></hr>
{% endif %}
{% endfor %}
</body>
</html>
这一行:
{% if person.filter("height <", max_height %)
{%if person.filter(“高度+1谢谢Blender。我修复了代码。我仍然在“max\u height”:max\u height行上遇到相同的错误。是模板值不允许我这样传递变量吗?错误是…第20行“max\u height”:max\u height。语法错误:无效syntax@Anthony:尝试在max\u height
后加逗号。
{% if person.filter("height <", max_height %)
{% if person.filter("height <", max_height) %}