1👍
Try something like this as a mixin:
class RedirectURLView(View):
def get_success_url(self):
next_url = self.request.GET.get('next')
if next_url:
return next_url
else:
return super(RedirectURLView, self).get_success_url()
then append ?next={{ request.path }}
to the urls
Source:stackexchange.com