title: django create user and log them in
body: <p>In a view I'm trying to create a new user and then log them in but result in a new url on success.</p>
  
  <pre><code>def create(request):
  
      if request.method == "POST":
  
          # do user creation #
          user.save()
  
          auth_user = authenticate(username=user.username,password=user.password)
  
          if auth_user is not None:
              login(request, auth_user)
  
              return HttpResponseRedirect('/user/account/')
  
      return render_to_response('create_form.html')
  </code></pre>
  
  <p>So, how do I maintain the <code>user</code> object using the <code>HttpResponseRedirect</code> or validate the logged in user in an unassociated view?</p>