开发者

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

开发者 https://www.devze.com 2023-03-06 16:55 出处:网络
This question already has answers here: Closed 11 years ago. Pos开发者_JAVA技巧sible Duplicate: Get the current URL within a django template
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

精彩评论

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