我尝试过
{% if request.path == "/{{user.username}}" %}
You are in Contact</p>
{% else %}
nono
但这不起作用
答案 0 :(得分:1)
如果失败,则输出一些有用的信息,以便您了解原因:
{% if request.path == "/{{ user.username }}" %}
You are in Contact
{% else %}
{{ request.path }} is not the same as /{{ user.username }}
{% endif %}