title: Passing kwargs to Django URL and views
body: <p>I would like to pass kwargs to my view function through URL.</p>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>urlpatterns = [
  
  # ------------- set relations --------------------
  url(r'^approve-form/$', views.approve_form,
  {'content_type':None, 'form_id':None,}, name='approve-form'),]
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <p><code>def approve_form(request, content_type=None, form_id=None):
      return  HttpResponse('Working')</code></p>
  
  <p>Now I am using <code>reverse_lazy</code> function to call the url from on of the model instance</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class FormStatus(models.Model):
      content_type = models.ForeignKey(ContentType)
      form_id = models.IntegerField(verbose_name='Form Ref ID')
  
  
      def __str__(self):
          return "{}".format(self.content_type)
  
  
      def get_approve_link(self):
          return  reverse_lazy("flow-control:approve-form", kwargs={'form_id':self.form_id,
                                                                'content_type':self.content_type})'
  </code></pre>
  
  <p><strong>ERROR</strong></p>
  
  <pre><code>Reverse for 'approve-form' with arguments '()' and keyword arguments '{'content_type': &lt;ContentType: admin sanc model&gt;, 'form_id': 12}' not found. 1 pattern(s) tried: ['flow-control/approve-form/$']
  </code></pre>
  
  <p>Is something wrong with the approach or is there any better approach for this ?</p>
  
  <p>Thanks in advance.</p>
  
  <p>PS: I tried the <a href="https://docs.djangoproject.com/en/1.11/topics/http/urls/#passing-extra-options-to-view-functions" rel="nofollow noreferrer">url documentation</a> but couldn't figure it out.</p>