Reputation: 2303
I'm Prety new in Django. I want to know how to return to the previous page from view to template without taking path or url.
Upvotes: 0
Views: 680
Reputation: 174
Pretty sure this is a duplicate but
Try this:
from django.http import HttpResponseRedirect
def someview(request):
...
return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
Upvotes: 2