[Answer]-Django RedirectView that takes an argument

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.

https://docs.djangoproject.com/en/1.7/ref/class-based-views/base/#django.views.generic.base.RedirectView.pattern_name

Leave a comment