Which is it better to use generally?
https://docs.djangoproject.com/en/dev/topics/http/shortcuts/#redirect
https://docs.djangoproject.com/en/dev
From documentation -
redirect(to[, permanent=False], *args, **kwargs)
Returns anHttpResponseRedirect
to the appropriate URL for the arguments passed.
from the definition its the same. Thats what shortcuts are for. Both are one and the same.
shortcuts generally are written one level above the actual API's. So redirect
encapsulates HttpResponseRedirect
and HttpResponsePermanentRedirect
with the arg permanent=False
.
There is no major downside to using HttpResponseRedirect
over redirect
. Hope this clears it.