title: Django dynamically get view url and check if its the current page
body: <p>Consider this basic menu:</p>
  
  <pre><code>&lt;ul class="nav navbar-nav"&gt;
    &lt;li class="active"&gt;&lt;a href="{% url 'home' %}"&gt;Home&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="{% url 'about' %}"&gt;About&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I'm trying to give the current page's link an active class, and I want to do this dynamically based on current url and the view's url. So that when a user visits the about page, that page now has the active class and the homepage does not. </p>
  
  <p>I'd like to logic to work like this inside of the <code>&lt;li&gt;&lt;/li&gt;</code> tags:</p>
  
  <pre><code>{% if request.get_full_path = "{% url 'home' %}" %}class="active"{% endif %}
  {% if request.get_full_path = "{% url 'about' %}" %}class="active"{% endif %}
  </code></pre>
  
  <p>but clearly I cant have two <code>{% ... %}</code> nested inside of each other.</p>
  
  <p>Any ideas on how to get around nesting the two?</p>