I struggled with this, sorted it out a bit and looked at the documentation, so I think its time to ask. I am trying to make my application redirected to the last page viewed after logging in. I am running django 1.2.4 and still no luck.
This stack overflow problem seemed as if it was a trick, but I had no success: Django: redirecting to the previous page after logging in ...
Currently, after logging in from any view, I am redirected to: // localhost: 1100 / accounts / profile /
settings.py has this code: "django.core.context_processors.request",
With this, as a login link: <a href="{% url django.contrib.auth.views.login %}?next={{request.path}}">login</a>
I also committed to import RequestContext into the views.py file: from django.template import RequestContext
I get the impression that this is not working. I also noticed now the login URL has a partial following URL: // localhost: 1100 / accounts / login /? next =
Suggestions? Thank you in advance!
source share