开发者

How do I find the path of the url inside a django template? [duplicate]

This question already has answers here: Closed 11 years ago.

Pos开发者_JAVA技巧sible Duplicate:

Get the current URL within a django template

For example I would like something like this inside the template:

            {% if path == 'login' %}
                <li class="current_page_item"> <a href="{% url login-view %}"> {{ 'Login' }}</a></li>
            {% else %}
                <li> <a href="{% url login-view %}"> {{ 'Login' }}</a></li>
            {% endif %}     


request.get_full_path

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜