django httpResponseRedirect带有响应
如何在django中使用httpresponseredirect发送响应? 我尝试过的事情:django httpResponseRedirect带有响应,django,httpresponse,Django,Httpresponse,如何在django中使用httpresponseredirect发送响应? 我尝试过的事情: response = HttpResponseRedirect("Authentication failed! Try again!") response['Location'] = '/permissionDenied' return response 我可以在标题中发送响应,如 response['error']:"Authentication
response = HttpResponseRedirect("Authentication failed! Try again!")
response['Location'] = '/permissionDenied'
return response
我可以在标题中发送响应,如
response['error']:"Authentication failed! Try again!"
但是我需要在响应中发送它,以便ui处理它。class HttpResponseReserDirect。构造函数的第一个参数是必需的–重定向到的路径。