title: How to get an argument coming from urls.py in views.py
body: <p>So, I'm currently using Class-based views in Django and I have this url dispatcher in my <code>urls.py</code>.</p>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>url(r'^(?P&lt;store_domainKey&gt;.*)/$', views.StoreDetailView.as_view(), name='detail'),
  </code></pre>
  
  <p>and in views.py I wanna get an argument coming from the <code>store_domainKey</code>, and it is like the following.</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>class StoreDetailView(DetailView):
      model = Store
      template_name = 'boutique/detail.html'
  
      def get_queryset(self, store_domainKey):
          store = ???
  </code></pre>
  
  <p>What I wanna do is access <code>store_domainKey</code> in my <code>get_queryset()</code> function to assign the value in a variable <code>store</code>. How can I do that?                </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The reason why I need above is because I'm trying to change my FBV to CBV. I was getting <code>store_domainKey</code> from urls.py to views.py by doing the following in my FBV views.</p>
  
  <pre><code>def detail(request, store_domainKey):
      store = get_object_or_404(Store, domainKey=store_domainKey)
  </code></pre>
  
  <p>I just wanna do the same thing in my CBV views as well. But, <code>get_object_or404</code> doesn't work.</p>
  
  <p>It just throws the following error.</p>
  
  <pre><code>TypeError at /downeast/
  get_queryset() missing 1 required positional argument: 'store_domainKey'
  </code></pre>