how to add an active class to current element in navbar in django

48

how to add an active class to current element in navbar in django -

<li {% if request.resolver_match.url_name == 'home' %}class="active"{% endif %}>
    <a href="/">HOME</a>
</li>

Comments

Submit
0 Comments