📜  httpresponseredirect 与重定向 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:48.588000             🧑  作者: Mango

代码示例1
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.