在pythondjang中如何使用html中的小于或大于符号

2024-04-20 06:07:05 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我正在努力使用html模板中的大于号。我使用的是Python3.7.2和Django1.8.6 我不能在这里执行这个代码,因为有一个错误

{% extends "base.html" %} {% block Content %} <h1>Tags</h1> {% for instance in object_list %} <li><a href='{{ instance.get_absolute_url }}'>{{ instance.title }}</a> ({{ instance.products.count }} product{% if instance.products.count > 1 %}s{% endif %})</li> {% empty %} <li>No Tags yet.</li> {% endfor %} </ul> {% endblock %}

所以这里的问题是>;1 救命啊


Tags: instance代码模板basehtmlcount错误tags