from django.http import HttpResponseRedirect def someview(request): ... return HttpResponseRedirect(request.META.get('HTTP_REFERER'))