title: Cannot convert dictionary update sequence element #0 to a sequence
body: <p>I'm trying to store form field variable with <code>Django cache</code> and I add Django form in my view.</p>
  
  <p>I'm getting this error and I don't see what will be wrong in my script :</p>
  
  <pre><code>Cannot convert dictionary update sequence element #0 to a sequence
  </code></pre>
  
  <p>Do you have any idea ? All seems right from my point of view.</p>
  
  <p>The error comes from this line : </p>
  
  <pre><code>return render(request, 'form.html', {'form' : form})
  </code></pre>
  
  <p>This is my script function :</p>
  
  <pre><code>def Function_Form(request) :
  
      query_lastname = request.GET.get('lastname')
      cache.set('query_lastname', query_lastname, 300)
      print cache.get('query_lastname')
  
      if request.method == 'POST':
  
          form = Formulary(request.POST or None)
  
          if form.is_valid() :   
              if '_save' in request.POST :
                  post = form.save()
                  return HttpResponseRedirect(reverse('treated', kwargs={'id': post.id}))
  
      else:
          form = Formulary()
  
      return render(request, 'form.html', {'form' : form})
  </code></pre>
  
  <p><strong>EDIT :</strong></p>
  
  <p>We are both working on this project with @Valentin. I'm trying to help him on this part.</p>
  
  <p><strong>Full Traceback :</strong></p>
  
  <pre><code>Environment:
  
  
  Request Method: GET
  Request URL: http://localhost:8000/BirthCertificate/formulaire
  
  Django Version: 1.10.3
  Python Version: 2.7.12
  Installed Applications:
  ['django.contrib.admin',
   'django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.sessions',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'BirthCertificate',
   'Identity',
   'bootstrapform',
   'Accueil',
   'django_countries',
   'log',
   'Mairie',
   'Table',
   'Recensement',
   'Configurations',
   'debug_toolbar']
  Installed Middleware:
  ['django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.locale.LocaleMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.middleware.gzip.GZipMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware',
   'django.middleware.security.SecurityMiddleware',
   'debug_toolbar.middleware.DebugToolbarMiddleware']
  
  
  
  Traceback:
  
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py" in inner
    39.             response = get_response(request)
  
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _legacy_get_response
    249.             response = self._get_response(request)
  
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
    187.                 response = self.process_exception_by_middleware(e, request)
  
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in _get_response
    185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
    23.                 return view_func(request, *args, **kwargs)
  
  File "/Users/valentinjungbluth/Desktop/Django/Etat_civil/BirthCertificate/views.py" in BirthCertificate_Form
    55.     return render(request, 'BC_form.html', {'Bform' : Bform})
  
  File "/usr/local/lib/python2.7/site-packages/django/shortcuts.py"  in render
    30.     content = loader.render_to_string(template_name, context, request, using=using)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
    68.     return template.render(context, request)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/backends/django.py" in render
    66.             return self.template.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    206.                 with context.bind_template(self):
  
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py" in __enter__
    17.             return self.gen.next()
  
  File "/usr/local/lib/python2.7/site-packages/debug_toolbar/panels/templates/panel.py" in _request_context_bind_template
    51.         updates.update(context)
  
  Exception Type: TypeError at /BirthCertificate/formulaire
  Exception Value: cannot convert dictionary update sequence element #0 to a sequence
  </code></pre>
  
  <p>His script is exactly this :</p>
  
  <pre><code>def BirthCertificate_Form(request) :
      # Fonction permettant de créer le formulaire Acte de Naissance et le remplissage
  
      query_lastname = request.GET.get('lastname')
      cache.set('query_lastname', query_lastname, 300)
      print cache.get('query_lastname')
  
      if request.method == 'POST':
  
          Bform = BirthCertificateForm(request.POST or None)
  
          if Bform.is_valid() :   # Vérification sur la validité des données
              if '_save2' in request.POST :
                  post = Bform.save()
                  return HttpResponseRedirect(reverse('BC_treated', kwargs={'id': post.id}))
  
      else:
          Bform = BirthCertificateForm()
  
      return render(request, 'BC_form.html', {'Bform' : Bform})
  </code></pre>