I have checked most of the comments and the answer always was that Django (on local machine) handles only one request at a time. I have simple django application with view function that waits 5 seconds. When I run two the same GET requests in postman, I can see both requests are handled in the same time, they are not queued or overwritten one by another. My question is how it is possible?
My view code:
def wait_some_time(request):
import time
print("Printed immediately.")
time.sleep(5)
print("Printed after 5 seconds.")
return Response({'message': 'nothing'})
Postman request: Postman request (I'm sending 2 requests in the same time)
Console output:
Printed immediately.
Printed immediately.
Printed after 5 seconds.
[05/Jan/2022 14:55:35] "GET /api/user/test HTTP/1.1" 200 21
Printed after 5 seconds.
[05/Jan/2022 14:55:36] "GET /api/user/test HTTP/1.1" 200 21