title: Django How to Exclude GET Parameters When Comparing Current Page to request.get_full_path
body: <p>I have my templates set up in a way similar to this:</p>
  
  <pre><code>{% url 'index' as index %}
  
  &lt;div&gt;
      {% if request.get_full_path == index %}
          This is the index
      {% else %}
          This is not the index
      {% endif %}
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the issue: If my page has a get request attached to the url, then the comparison automatically fails. So, even if I am on <code>/index/?q=search-results</code>, the <code>request.get_full_path == index</code> comparison fails. Is there a solution to strip get queries from the comparison?</p>