Whenever a request is made to a web page, Django creates an HttpRequest object that contains metadata about the request. After that Django loads the particular view, passing the HttpRequest as the first argument to the view function. Each view will be returning an HttpResponse object.
On the big picture following steps occur when a request is received by Django:
First of the Django settings.py file is loaded which also contain various middleware classes (MIDDLEWARES)
The middlewares are also executed in the order in which they are mentioned in the MIDDLEWAREST
From here on the request is now moved to the URL Router, who simply gets the URL path from the request and tries to map with our given URL paths in the urls.py.
As soon as it has mapped, it will call the equivalent view function, from where an equivalent response is generated
The response also passes through the response middlewares and send back to the client/browser.