title: django: form to json
body: <p>I am trying to serialize my form into the json format. My view:</p>
  
  <pre><code>form = CSVUploadForm(request.POST, request.FILES)
  data_to_json={}
  data_to_json = simplejson.dumps(form.__dict__)
  return HttpResponse(data_to_json, mimetype='application/json')
  </code></pre>
  
  <p>I have the error <code>&lt;class 'django.forms.util.ErrorList'&gt; is not JSON serializable</code>. What to do to handle django forms?</p>