title: Django: Passing Kwargs as form Values to generic CBV Form
body: <p>I have a form in which the value of the first field can be determined by the URL. ie: <code>example.com/value/form</code> in which <code>value</code> is the appropriate response to the first field on the form.</p>
  
  <p>How can I pass this value to the form on the page? </p>
  
  <pre><code>class VarietyCreate(CreateView):
      template_name = "generic_create.html"
      model = Variety
      form_class = VarietyForm
      pk_url_kwarg = "pk"
      initial = {"product_group" : pk_url_kwarg}
  
      def get_success_url(self):
          return reverse("purchases:Variety Index", kwargs={'pk': self.kwargs.get('pk')})
  </code></pre>
  
  <p>What I have does not seem to work.</p>
  
  <p>From my URLs:</p>
  
  <pre><code>url(r'^commodities/view/(?P&lt;pk&gt;[^\/]+)/create/$', views.VarietyCreate.as_view(), name='Variety Create'),
  </code></pre>