title: Django: DetailView implementing a get_queryset()
body: <p>I'm getting this following error:</p>
  
  <pre><code>ImproperlyConfigured at /elearning/7447932a-6044-498a-b902-97cbdd0a4001/
  DetailView is missing a QuerySet. Define DetailView.model, DetailView.queryset, or override DetailView.get_queryset().
  </code></pre>
  
  <p>Following the Django documentation on <a href="https://docs.djangoproject.com/fr/1.11/ref/class-based-views/generic-display/#detailview" rel="noreferrer">DetailView</a> the get_query is not mandatory unless that I want to override it.</p>
  
  <p>view.py</p>
  
  <pre><code>class CourseDetailView(DetailView):
  
      model = Course
      template_name='elearning/detail.html'
  
      def get_object(self):
          course = get_object_or_404(Course, pk=self.kwargs['pk'])
          return self.model.objects.filter(pk=pk)
  
      def get_context_data(self, **kwargs):
          context = super(CourseDetailView, self).get_context_data(**kwargs)
          context['now'] = timezone.now()
          return context
  </code></pre>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^(?P&lt;pk&gt;[0-9a-z-]+)/$', views.DetailView.as_view(), name='course-detail'),
  </code></pre>
  
  <p>listview template</p>
  
  <pre><code> &lt;a href="{% url 'elearning:course-detail' article.course_id %}"&gt;{{ article.title }}&lt;/a&gt;
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class Course(models.Model):
      course_id = models.UUIDField(default=uuid.uuid4, editable=False)
      ...
  </code></pre>
  
  <p>I would like to know why should I implement a get_queryset()?</p>
  
  <p>I still get the same error when I add a get_queryset()</p>
  
  <pre><code>def get_queryset(self):
      qs = super(CourseDetailView, self).get_queryset()
      return qs.filter(pk=self.kwargs['pk'])
  </code></pre>