Django uses the request and response objects to pass state between systems.
When a page is consulted, Django creates a HttpRequest object that contains the request metadata. Django then enters the appropriate view, passing HttpRequest as the first parameter to the view function. Each view is responsible for returning a HttpResponse object.
The properties of the HttpRequest instance contain most of the important information about this request. All attributes except the session should be considered read-only.
REQUEST |
Created for convenience, this is a class Dictionary object that searches for POST before searching for GET . Inspired by PHP's $_reqeust . For example, if GET = {"Name": "John"} , POST = {"Age": ' '} c5>, request["name" will be "John" , request["age" will be " a". It is strongly recommended to use GET and POST instead of REQUEST . This is for forward compatibility and clearer representation. |
The request in Django's views