The django documentation states:
When a page is requested, Django creates an HttpRequest object that
contains metadata about the request. Then Django loads the appropriate
view, passing the HttpRequest as the first argument to the view
function. Each view is responsible for returning an HttpResponse
object.
Example:
from django.http import HttpResponse
import datetime
def current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)
Each view function takes an HttpRequest object as its first parameter, which is typically named request.
What kind of metadata does the request argument holds and gets passed to the view function when called?
Have a look at the docs.
It contains python representations for various attributes of an http request.
examples –