1👍
✅
Trying to set success_url
will not work, because it is processed when the module is loaded, not when the request is handled. Override get_success_url
instead.
You can access positional and keyword arguments from the url from self.args
and self.kwargs
respectively.
def get_success_url(self):
return reverse(self.kwargs['uri'])
Source:stackexchange.com