PyCharm在模板

时间:2017-03-03 18:40:25

标签: django django-templates pycharm

<div class="person_roles_div">
    <table>
        <thead></thead>

        <tbody>
            {% for position in person.positions %}
                <tr>
                    <td>{{ position.provider|default:"" }} {{ position.role }}</td>
                    <td>{{ position.facility|default:"" }}</td>
                    <td>{{ position.startdate|default:"" }}</td>
                    <td>{{ position.enddate|default:"" }}</td>
                    <td>
                        <button id="remove_position_sk_{{ position.position_sk }}" class="position_remove_button">Remove</button>
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</div>

在输出上下文变量并指定默认值的前四个td标记中,PyCharm在每个:之前和之后突出显示""和空格

hovertip消息为(( or {% expected。页面运行正常。

知道我应该看什么设置?

1 个答案:

答案 0 :(得分:9)

它&#34; Python模板语言&#34;。看截图: enter image description here

确保将其设置为&#34; Django&#34;