I am not getting the difference between HttpResponse n HttpResponseRedirect
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
HttpResponseRedirectis meant to send a 3xx HTTP code and redirectto another URL (that is, the response is a redirect header).
It is actually a subclass of
HttpResponse, and can be used as a shortcutfor redirects.
HttpResponse, on the other hand is the main response object, where you canset headers / body, etc (and is what you usually use for sending a rendered
template and so on — ok, render_to_response also does that, but it is a
shortcut function).