title: Polls application — django tutorial not working
body: <p>I am working through the <a href="https://docs.djangoproject.com/en/1.10/intro/tutorial01/" rel="nofollow noreferrer">Polls tutorial for Django</a>. I have made it as far as the start of part six.</p>
  
  <p>For some reason all of my class based generic views are working <strong>EXCEPT</strong> the class based index view. When trying to load localhost:8000/ I get the following error:</p>
  
  <pre><code>Page not found (404)
  Request Method: GET
  Request URL:    http://localhost:8000/
  
  Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
  ^polls/
  ^admin/
  
  The current URL, , didn't match any of these.
  </code></pre>
  
  <p>Here is my mysite/urls.py:</p>
  
  <pre><code>from django.conf.urls import include, url
  from django.contrib import admin
  
  
  urlpatterns = [
     url(r'^polls/', include('polls.urls')),
     url(r'^admin/', admin.site.urls),
  ]
  </code></pre>
  
  <p>And here is my polls/urls.py</p>
  
  <pre><code>from django.conf.urls import url
  
  from . import views
  
  app_name = 'polls'
  
  urlpatterns = [
     url(r'^$', views.IndexView.as_view(), name='index'),
     url(r'^(?P&lt;pk&gt;[0-9]+)/$', views.DetailView.as_view(), name='detail'),
     url(r'^(?P&lt;pk&gt;[0-9]+)/results/$', views.ResultsView.as_view(), name='results'),
     url(r'^(?P&lt;question_id&gt;[0-9]+)/vote/$', views.vote, name='vote'),
  ]
  </code></pre>
  
  <p>And here is the polls/views.py. I am just pasting the IndexView portion. The rest of the class based views are currently working:</p>
  
  <pre><code>from django.shortcuts import get_object_or_404, render
  from django.http import HttpResponseRedirect
  from django.urls import reverse
  from django.views import generic
  from django.utils import timezone
  
  from .models import Choice, Question
  
  # Create your views here.
  class IndexView(generic.ListView):
      template_name = 'polls/index.html'
      context_object_name = 'latest_question_list'
  
      def get_queryset(self):
          # Return last five published questions (not inc. future)
          return Question.objects.filter(
          pub_date__lte=timezone.now()
          ).order_by('-pub_date')[:5]
  </code></pre>
  
  <p>Am I missing something? Any help would be greatly appreciated.</p>