title: passing a variable into url to query DB
body: <p>in my url I want to pass a key and query the DB on that View, based on that key :</p>
  
  <pre><code>#url.py
  
     path('view/&lt;slug:secret_key&gt;/',DetailMessage.as_view(),name='message'),
  </code></pre>
  
  <h1>view.py</h1>
  
  <pre><code>class DetailMessage(generic.DetailView):
      model = Message
  
  
      template_name = 'msg/view.html'
      def get_queryset(self):
          queryset = super().get_queryset()
          key =self.request.get('secret_key',None) 
  
          return queryset.get(secret_key=key)
  </code></pre>
  
  <p>But I receive this error :</p>
  
  <pre><code>WSGIRequest' object has no attribute 'get' 
  </code></pre>