1👍
✅
Definitely worthwhile. Check out what RedirectView
does. For one, it redirects all methods by default PUT
, POST
, HEAD
etc. while View
would throw a 405
for everything but get
And definitely override get_redirect_url
to take advantage of the above.
It could be simpler via setting the pattern_name
attribute only, but it looks like you need the urlconf
kwarg as well so this method may not work.
Source:stackexchange.com