title: Incorrect captcha and empty fields in form in django application
body: <p>In my django application - I have a view of the form. The problem is that when I have the wrong captcha, other data (name, e-mail, message) are empty, and should be filled with the entered data.</p>
  
  <p><strong>view.py</strong></p>
  
  <pre><code>def contact(request):
      form = ContactForm(request.POST)
      key = CaptchaStore.generate_key()
      image_url = captcha_image_url(key)
      if form.is_valid():
          data = request.POST.copy()
          data.__delitem__('val')
          data.__delitem__('check1')
          data.__delitem__('check2')
          data.__delitem__('csrfmiddlewaretoken')
          msg = '\n'.join(['%s %s' % (i, data[i]) for i in data if data[i]])
          try:
              mail_managers(_('Contact Form'), msg)
              contact_confirm(form.cleaned_data['email'])
          except Exception:
              return HttpResponse(json.dumps({'success': False, 'key': key, 'image_url': image_url,
                  'message': _('Sorry there was an error while sending email.')}))
          return HttpResponse(json.dumps({'success': True, 'message': _('Message was sent')}))
  
      message = ", ".join(["%s: %s"%x for x in form.errors.iteritems()]).replace("__all__:","")
  
      return HttpResponse(json.dumps({'success': False, 'message': message,
                                      'key': key, 'image_url': image_url}))
  </code></pre>