Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么Aptana在Django模板中运行注释?_Html_Django_Templates_Aptana3 - Fatal编程技术网

Html 为什么Aptana在Django模板中运行注释?

Html 为什么Aptana在Django模板中运行注释?,html,django,templates,aptana3,Html,Django,Templates,Aptana3,这是一种奇怪的行为,或者我错过了更深层次的东西 在my Django模板中,此代码段导致错误: {% if scale.pk %} <!-- <a class='btn btn-success' style = 'float:left;' href="{% url "scale_update" pk=scale.pk %}">Edit Scale</a> --> <a class='btn btn-danger' style = 'float:righ

这是一种奇怪的行为,或者我错过了更深层次的东西

在my Django模板中,此代码段导致错误:

{% if scale.pk %}
<!-- <a class='btn btn-success' style = 'float:left;' href="{% url "scale_update" pk=scale.pk %}">Edit Scale</a> -->

<a class='btn btn-danger' style = 'float:right;' href="{% url "scale_delete" pk=scale.pk %}">Delete Scale</a>
{% endif %}
另一方面,当我完全删除已评论的部分时,它会按照预期的方式工作。只有一个Python实例正在运行


我是否遗漏了一些关于html或django的内容?或者它是Aptana中的一个bug?

Django不关心HTML注释。它将呈现在页面上找到的所有标记。据它所知,您希望将该文本呈现为注释

如果您根本不想呈现某些内容,则需要使用Django注释标记,而不是HTML标记:对于单行,可以使用
{{{{}…}
,对于多行,可以使用
{%comment%}…{%endcomment%}

NoReverseMatch at /scales/
Reverse for 'scale_update' with arguments '()' and keyword arguments '{u'pk': 1}' not found.