Redirect from Generic View DetailView in Django
问题 I'm using Django's class based DetailView generic view to look up an object for display. Under certain circumstances, rather than displaying the object, I wish to back out and issue a HTTP rediect instead. I can't see how I go about doing this. It's for when a user hits an object in my app, but without using the canonical URL. So, for example, on StackOverflow URLs take the form: http://stackoverflow.com/<content_type>/<pk>/<seo_friendly_slug> eg: http://stackoverflow.com/questions/5661806