How a request is process in Django ?

Submitted 3 years, 5 months ago
Ticket #287
Views 227
Language/Framework Django
Priority Medium
Status Closed

Can someone explain How a request is process in Django ?

Submitted on Nov 10, 20
add a comment

1 Answer

Verified

Whenever a request comes into Django, it is handled by middlewares. When the Django server starts, the first thing it loads after settings.py is middlewares.

The Request is processed by various middlewares one at a time. So, from the above list, when the request comes it will be passed through the security middleware. If it deems it to be unhealthy, then it will not let the request go any further.

Otherwise, the authentication requests are handled by authentication middleware. That comes after 4 middleware classes that didn’t find how to handle that request.

Once, our request is processed by these middlewares it is passed to the URL Router. The URL router simply extracts the URL from the request and will try to match it to defined URLs.

Submitted 3 years, 5 months ago


Latest Blogs