title: Django login doesn't work
body: <p>I tried to create a login view like the following:</p>
  
  <pre><code>def user_login(request):
      if request.method == 'POST':
          username = request.POST.get('username')
          password = request.POST.get('password')
  
          user = authenticate(username=username, password=password)
  
          if user:
              if user.is_active:
                  login(request, user)
                  return HttpResponseRedirect('rango/index.html')
              else:
                  return HttpResponse('Your Rango account is disabled!')
          else:
              print("Invalid login details: {0}, {1}".format(username, password))
              return HttpResponse("Invalid login details supplied!")
      else:
          return render(request, 'rango/login.html', {})
  </code></pre>
  
  <p>This seems to be the correct way to do so, but when I try to open the page in my browser, I get the following error:</p>
  
  <pre><code>TypeError at /rango/login/
  login() missing 1 required positional argument: 'user'
  Request Method: GET
  Request URL:    http://localhost:8000/rango/login/
  
  Django Version: 1.9.10
  Exception Type: TypeError
  Exception Value:    
  login() missing 1 required positional argument: 'user'
  Exception Location: C:\Users\Johannes\tangowithdjango\lib\site-packages\django\core\handlers\base.py in get_response, line 147
  Python Executable:  C:\Users\Johannes\tangowithdjango\Scripts\python.exe
  Python Version: 3.6.0
  Python Path:    
  ['C:\\Users\\Johannes\\tangowithdjango\\tango_with_django_project',
   'C:\\Users\\Johannes\\tangowithdjango\\Scripts\\python36.zip',
   'C:\\Users\\Johannes\\AppData\\Local\\Programs\\Python\\Python36\\DLLs',
   'C:\\Users\\Johannes\\AppData\\Local\\Programs\\Python\\Python36\\lib',
   'C:\\Users\\Johannes\\AppData\\Local\\Programs\\Python\\Python36',
   'C:\\Users\\Johannes\\tangowithdjango',
   'C:\\Users\\Johannes\\tangowithdjango\\lib\\site-packages']
  Server time:    Thu, 12 Jan 2017 17:56:38 +0100
  </code></pre>
  
  <p>Has anyone encountered something similar or knows a solution to the problem? I already searched and tried around for a bit but couldn't find an answer.</p>