title: Django Date-Based Generic Views: How to Access Variables
body: <p>I have a series of urls tied to Django's generic date views. In the extra_context parameter, I'd like to pass in a queryset based off the year/ month variables in the URLs, but I'm not sure how to access them. For example, in</p>
  
  <pre><code>url(r'^archive/(?P&lt;year&gt;20[1-2][0-9])/?$', archive_year,
  {'queryset': Article.objects.all(),
  'date_field': 'publication_date',
  'template_name': 'articles/archive-date-list.html',
  'extra_context': {'content': 'articles'}},
  name='article_archive'),
  </code></pre>
  
  <p>I'd like to add in the 5 most recent articles where the publication date's year is gte <code>year</code> and lt <code>year + 1</code>. Ideally, the collection would be looked up on each request and not just cached at compile time. Am I better off writing a context processor for this/ extending the view?</p>