title: How do I use the The login_required decorator in my URL?
body: <p>I want to check that the user is authorized for certain URLs. I'm using generic views.</p>
  
  <p><a href="http://docs.djangoproject.com/en/dev/ref/generic-views/?from=olddocs#create-update-delete-generic-views" rel="noreferrer">The docs here</a> say the login_required can be passed as an optional arguments but I'm not sure. Something like this maybe: <code>(r'^$', 'archive_index', link_info_dict, 'coltrane_link_archive_index', login_required=True,),</code></p>
  
  <p>I have this and I would like to be able to use the login_required decorator within the URL. Is it possible? How can I do it?</p>
  
  <pre><code>from django.conf.urls.defaults import *
  
  from coltrane.models import Link
  
  link_info_dict = {
      'queryset': Link.live.all(),
      'date_field': 'pub_date',
  }
  
  urlpatterns = patterns('django.views.generic.date_based',
      (r'^$', 'archive_index', link_info_dict, 'coltrane_link_archive_index'),
  
      (r'^(?P&lt;year&gt;\d{4})/$', 'archive_year', link_info_dict, 'coltrane_link_archive_year'),
  
      (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\w{3})/$', 'archive_month', link_info_dict, 'coltrane_link_archive_month'),
  
      (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\w{3})/(?P&lt;day&gt;\d{2})/$', 'archive_day', link_info_dict, 'coltrane_link_archive_day'),
  
      (r'^(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\w{3})/(?P&lt;day&gt;\d{2})/(?P&lt;slug&gt;[-\w]+)/$', 'object_detail', link_info_dict, 'coltrane_link_detail'),
  </code></pre>
  
  <h2>    )</h2>
  
  <hr>
  
  <p>For example how would I protect this page here(there's no view to add the login_Required decorator to)? </p>
  
  <pre><code>(r'^$', 'django.views.generic.simple.direct_to_template', {
          'template': 'home.html'
      }, ),
  </code></pre>