title: Passing **kwargs to Django Form
body: <p>I am trying to build custom django form for changing username and user email for an application. That's why I need to pass the user details from the session to a form in order to check if the logged user exists. I am doing in this way:</p>
  
  <p>in views.py</p>
  
  <pre><code>personal_info_form = PersonalInfoForm(prefix='personal_info',
                                        user_details=user_details)
  </code></pre>
  
  <p>where <code>user_details</code> is a dictionary:</p>
  
  <pre><code>'user_details': [{'username': u'username', 
                    'registration_date': datetime.date(2009, 10, 22), 
                    'id': 13, 'email': u'user@mail.com'}]}
  </code></pre>
  
  <p>In forms.py I have the following code:</p>
  
  <pre><code>class PersonalInfoForm(forms.Form):
  
      def __init__(self, *args, **kwargs):
          user_details = kwargs.pop('user_details', None)
          super(PersonalInfoForm, self).__init__( *args, **kwargs)
  
      username = forms.CharField(required=True, initial=user_details[0]['username'])
      email = forms.EmailField(required=True)
  </code></pre>
  
  <p>And I get the following error:</p>
  
  <pre><code>name 'user_details' is not defined
  </code></pre>
  
  <p>I tried accessing it with <code>self.user_details</code> and only <code>user_details</code> and it gives me the same error </p>