title: Issue with Django-forms: 'WSGIRequest' object has no attribute 'get'
body: <p>I am getting this error in the Django debug-view:</p>
  
  <pre><code>'WSGIRequest' object has no attribute 'get'
  </code></pre>
  
  <p>This is for a login-script, which most of is copied from the admin-code, mostly for practice/tweaking-reasons. The code I have, in views.py, is following:</p>
  
  <pre><code>@sensitive_post_parameters()
  @csrf_protect
  @never_cache
  def login(request, template_name="main/login.html",
            authentication_form=LoginForm,
            redirect_field_name=REDIRECT_FIELD_NAME,
            current_app=None, extra_context=None):
      """
      Displays the login form and handles the login action.
      """
      redirect_to = request.REQUEST.get(redirect_field_name, '')
  
      if request.method == "POST":
          form = authentication_form(request, data=request.POST)
          if form.is_valid():
  
              # Ensure the user-originating redirection url is safe.
              if not is_safe_url(url=redirect_to, host=request.get_host()):
                  redirect_to = resolve_url(settings.LOGIN_REDIRECT_URL)
  
              # Okay, security check complete. Log the user in.
              user = get_user(request.POST.get('email'))
              auth_login(request, user)
  
              return HttpResponseRedirect(redirect_to)
      else:
          form = authentication_form(request)
      current_site = get_current_site(request)
  
      context = {
          'form': form,
          redirect_field_name: redirect_to,
          'site': current_site,
          'site_name': current_site.name,
      }
      if extra_context is not None:
          context.update(extra_context)
      return TemplateResponse(request, template_name, context,
                              current_app=current_app)
  </code></pre>
  
  <p>Here is my form:</p>
  
  <pre><code>class LoginForm(forms.Form):
      email = forms.CharField(max_length=100, label="email", widget=forms.TextInput(attrs={'class': 'form-control'}), required=True)
      password = forms.CharField(max_length=32, label="password", widget=forms.PasswordInput(attrs={'class': 'form-control'}), required=True)
  </code></pre>
  
  <p>And I am receiving my error on line 13 in login.html</p>
  
  <pre><code>{% extends 'base_main.html' %}
  {% load staticfiles %}
  
  {% block title %}Login{% endblock %}
  {% block stylesheet %}
      {{ block.super }}
      &lt;link rel="stylesheet" type="text/css" href="{% static 'main/css/login.css' %}"&gt;
  {% endblock %}
  
  {% block body %}
      &lt;div class="container"&gt;
          {% if form %}
              &lt;!--
              &lt;form class="form-signin" role="form" method="POST" action="/check_login/"&gt;{% csrf_token %}--&gt;
                  &lt;h2 class="form-signin-heading"&gt;Please sign in&lt;/h2&gt;
                  {{ form }} &lt;!-- Line 13 --&gt;
                  &lt;!--&lt;button class="btn btn-lg btn-primary btn-block" type="submit"&gt;Sign in&lt;/button&gt;
              &lt;/form&gt;
              --&gt;
          {% endif %}
      &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>Anyone got any ideas to how I could solve this?</p>
  
  <p>Update</p>
  
  <pre><code>Traceback:
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
    139.                 response = response.render()
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/response.py" in render
    105.             self.content = self.rendered_content
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
    82.         content = template.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
    140.             return self._render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in _render
    134.         return self.nodelist.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
    840.                 bit = self.render_node(node, context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
    78.             return node.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    123.         return compiled_parent._render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in _render
    134.         return self.nodelist.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
    840.                 bit = self.render_node(node, context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
    78.             return node.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    62.             result = block.nodelist.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
    840.                 bit = self.render_node(node, context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
    78.             return node.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
    305.                 return nodelist.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
    840.                 bit = self.render_node(node, context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
    78.             return node.render(context)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render
    91.             output = force_text(output)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/utils/encoding.py" in force_text
    100.                 s = s.__unicode__()
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in __str__
    103.         return self.as_table()
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in as_table
    223.             errors_on_separate_row = False)
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in _html_output
    148.         top_errors = self.non_field_errors() # Errors that should be displayed above all fields.
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in non_field_errors
    249.         return self.errors.get(NON_FIELD_ERRORS, self.error_class())
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in errors
    121.             self.full_clean()
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in full_clean
    273.         self._clean_fields()
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/forms.py" in _clean_fields
    282.             value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))
  File "/home/ryuu/Programming/Python/exobuild/venv/local/lib/python2.7/site-packages/django/forms/widgets.py" in value_from_datadict
    207.         return data.get(name, None)
  
  Exception Type: AttributeError at /login/
  Exception Value: 'WSGIRequest' object has no attribute 'get'
  </code></pre>