title: How to test if request.url matches a specific value
body: <p>I am using django, jinja2 and flask.</p>
  
  <p>I have the following URL format in <code>urls.py</code>:</p>
  
  <pre><code>urlpatterns = patterns('',
      url(r"^gigs/(?P&lt;pk&gt;[0-9]+)/$", 'gig.views.event_detail', name="event_detail"),
      url(r"^gigs/(?P&lt;pk&gt;[0-9]+)/basket/$", 'gig.views.event_basket', name="event_basket")
  )
  </code></pre>
  
  <p>In my template I use <code>{% url 'event_detail' pk=event.id %}</code> to produce the URL for the first page.</p>
  
  <p>How can I write a conditional statement to test if the current URL is this first page? Something like:</p>
  
  <pre><code>{% if request.url = url 'event_music' pk=event.id %}
  ...
  {% endif %}
  </code></pre>