how can I return to the previous page in Django 2
Clash Royale CLAN TAG#URR8PPP
how can I return to the previous page in Django 2
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.
1 Answer
1
Pretty sure this is a duplicate but
Try this:
from django.http import HttpResponseRedirect
def someview(request):
...
return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.