How do I find the path of the url inside a django template? [duplicate]
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
精彩评论