title: Django urls.py Regex Not Working Like I Expected
body: <p>I want to have a URL like these --</p>
  
  <pre><code>/chart/2012
  /chart/2009
  /chart/1996
  </code></pre>
  
  <p>...each #, is a year. So I added this line into my app's urls.py --</p>
  
  <pre><code>url(r'^chart/(?P&lt;year&gt;\d+)$',views.chart,name="chart"),
  </code></pre>
  
  <p>but it turns in a 404 when I go to the URL's. Shouldn't the <code>\d+</code> capture the digits into the <code>year</code> variable?</p>
  
  <p>(and yes, I do have a chart function defined in my views.py &amp; it works when I don't try to use a variable with it)</p>
  
  <p>UPDATE:</p>
  
  <p>Here's the full urls.py --</p>
  
  <pre><code>from django.conf.urls import patterns,url
  from musichart import views
  
  urlpatterns = patterns('',
      url(r'^$', views.index, name="index"),
      url(r'^chart/(?P&lt;year&gt;\d+)$',views.chart,name="chart"),
  )
  </code></pre>
  
  <p>Here's my views.py --</p>
  
  <pre><code>from django.shortcuts import render, get_object_or_404
  from django.http import HttpResponseRedirect, HttpResponse
  from django.template import RequestContext, loader #Context
  from musichart.models import Station,Song,Album,Related,Artist
  
  
  def index(request):
      template = loader.get_template('chart/index.htm')
      context = RequestContext(request, {
          'title': "Here is the title",
          'testvar': "blah blah blah testing 1 2 3",
          'numero': 17,
      })
      return HttpResponse(template.render(context))
  
  
  def chart(request, year):
      template = loader.get_template('chart/chart.htm')
      context = RequestContext(request, {
          'title': "Here is the title",
          'testvar': "blah blah blah testing 1 2 3",
          'numero': 17,
      })
      return HttpResponse(template.render(context))
  </code></pre>
  
  <p>As you can see, it's bare bones at the moment and just sort of testing to make sure things go through before I go any further. And the 404 page says --</p>
  
  <pre><code>Using the URLconf defined in msite.urls, Django tried these URL patterns, in this order:
  ^admin/
  ^accounts/
  ^chart/ ^$ [name='index']
  ^chart/ ^chart/(?P&lt;year&gt;\d+)$ [name='chart']
  ^health/
  The current URL, chart/2010, didn't match any of these.
  </code></pre>