how can I return to the previous page in Django 2

The name of the pictureThe name of the pictureThe name of the pictureClash 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.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS