Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
django httpResponseRedirect带有响应_Django_Httpresponse - Fatal编程技术网

django httpResponseRedirect带有响应

django httpResponseRedirect带有响应,django,httpresponse,Django,Httpresponse,如何在django中使用httpresponseredirect发送响应? 我尝试过的事情: response = HttpResponseRedirect("Authentication failed! Try again!") response['Location'] = '/permissionDenied' return response 我可以在标题中发送响应,如 response['error']:"Authentication

如何在django中使用httpresponseredirect发送响应? 我尝试过的事情:

    response = HttpResponseRedirect("Authentication failed! Try again!")
    response['Location'] = '/permissionDenied'
    return response
我可以在标题中发送响应,如

response['error']:"Authentication failed! Try again!"

但是我需要在响应中发送它,以便ui处理它。

class HttpResponseReserDirect。构造函数的第一个参数是必需的–重定向到的路径。