Answers for "httpresponseredirect vs redirect"

0

httpresponseredirect vs redirect

There is a difference between the two:

In the case of HttpResponseRedirect the first argument can only be a url.

redirect which will ultimately return a HttpResponseRedirect can accept a model, view, or url as it's "to" argument. So it is a little more flexible in what it can "redirect" to.

I also like how redirect is shorter. So I'd use redirect over HttpResponseRedirect.

Both are fine to use though.
Posted by: Guest on October-12-2021

Code answers related to "httpresponseredirect vs redirect"

Browse Popular Code Answers by Language