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.
Asked
Active
Viewed 678 times
1 Answers
2
Pretty sure this is a duplicate but
Try this:
from django.http import HttpResponseRedirect
def someview(request):
...
return HttpResponseRedirect(request.META.get('HTTP_REFERER'))

Henry Li
- 174
- 2
- 16