gpt4 book ai didi

python - 如何在 Django 模板中添加注释?

转载 作者:行者123 更新时间:2023-11-28 19:32:16 25 4
gpt4 key购买 nike

我想用一行评论:

{% if something.property %}
<table>
<tr>...



{% # this is a comment %}
{% if something.property %}
<table>
<tr>...

最佳答案

作为 Miles 的回答,{% comment %}...{% endcomment %} 用于多行注释,但您也可以像这样在同一行注释掉文本:

{# some text #}

关于python - 如何在 Django 模板中添加注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/719915/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com