【发布时间】:2019-02-26 08:55:51
【问题描述】:
我想在我的模板中使用“if”来显示“无内容”之类的消息。
我试过了:
views.py
{% for links in links_list %}
{% if links is None %}
<p>No content</p>
{% else %}
<p>some content</p>
{% endif %}{% endfor %}
它不起作用,谢谢。
【问题讨论】:
标签: python django if-statement django-templates