title: Redirecting to last view after login
body: <p>I have wrestled with this one for a bit and googled and looked through documentation, so I guess its time to ask. I am trying make my app redirect to the last viewed page after logging in. I am running django 1.2.4 and have had no luck so far. </p>
  
  <p>This Stack Overflow thread seemed like it would do the trick but I have not had success with it: 
  <a href="https://stackoverflow.com/questions/806835/django-redirect-to-previous">Django: Redirect to previous page after login</a>... </p>
  
  <p>Currently after logging in from any view I am redirected to: //localhost:1100/accounts/profile/ </p>
  
  <p>settings.py has this suggested code: 
      "django.core.context_processors.request", </p>
  
  <p>With this as my login button link: 
     <code>&lt;a href="{% url django.contrib.auth.views.login %}?next={{request.path}}"&gt;login&lt;/a&gt;</code>  </p>
  
  <p>I also made sure to import the RequestContext in my views.py file: 
      from django.template import RequestContext </p>
  
  <p>I get the impression this is not working. Also I noticed now 
  login URL has a partial next URL in it: 
  //localhost:1100/accounts/login/?next= </p>
  
  <p>Suggestions? 
  Thanks in advance! </p>