One of the way is using HTTP_REFERER
header like as below:
from django.http import HttpResponseRedirect
def someview(request):
...
return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
Not sure of cons of this!
More Related Contents:
- View doesn’t return HttpResponse
- Hi I am new to Django Framework.getting error :No Module Named
- Why does DEBUG=False setting make my django Static Files Access fail?
- How to use permission_required decorators on django class-based views
- Django – after login, redirect user to his custom page –> mysite.com/username
- Django : How can I see a list of urlpatterns?
- Django get the static files URL in view
- Execute code in Django after response has been sent to the client
- django – get() returned more than one topic
- How to handle request.GET with multiple variables for the same parameter in Django
- django: Purpose of django.utils.functional.SimpleLazyObject?
- Provide extra context to all views
- Can I call a view from within another view?
- Raw SQL queries in Django views
- How can I list urlpatterns (endpoints) on Django?
- Example of Django Class-Based DeleteView
- django @login_required decorator for a superuser
- Django – show loading message during long processing
- How to handle “matching query does not exist” when getting an object
- What is the right way to validate if an object exists in a django view without returning 404?
- Forbidden (403) CSRF verification failed. Request aborted
- CSRF verification failed. Request aborted. on django
- Multiple form classes in django generic (class) views
- django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. plz help me out plz
- How to view corresponding SQL query of the Django ORM’s queryset?
- Django – iterate number in for loop of a template
- How to convert a Django QuerySet to a list?
- Django: Can class-based views accept two forms at a time?
- How do I add a Foreign Key Field to a ModelForm in Django?
- Django — Conditional Login Redirect