Django 3 should be released soon and it will be able to work in ASGI mode. ASGI mode seems to make Django more efficient when handling requests than in WSGI mode (more requests can be handled per time unit if I believe correctly). How is it accomplished? Is it like that Django can handle at the same time multiple requests, but most of them will be waiting on events like fetching data from a database or other IO operations?
2 Answers
Major difference is synchronous vs asynchronous nature. A synchronous code was blocking though running in different thread or process and return response. There was no trigger approach for doing something else.
Async programming allowed to push piece of code in an event loop. Do something else until it executes, then after completion do something with it. This is non blocking and event based approach.
From the docs
What’s wrong with WSGI?
You may ask “why not just upgrade WSGI”? This has been asked many times over the years, and the problem usually ends up being that WSGI’s single-callable interface just isn’t suitable for more involved Web protocols like WebSocket.
WSGI applications are a single, synchronous callable that takes a request and returns a response; this doesn’t allow for long-lived connections, like you get with long-poll HTTP or WebSocket connections.
Even if we made this callable asynchronous, it still only has a single path to provide a request, so protocols that have multiple incoming events (like receiving WebSocket frames) can’t trigger this.
How does ASGI work?
ASGI is structured as a single, asynchronous callable. It takes scope, which contains details about the incoming request, send, an awaitable that lets you send events to the client, and receive, an awaitable which lets you receive events from the client.
This not only allows multiple incoming events and outgoing events for each application, but also allows for a background coroutine so the application can do other things (such as listening for events on an external trigger, like a Redis queue).

- 1
- 1

- 3,831
- 3
- 24
- 40
The situation you said is because you did not use asynchronous in the whole process of your request, because in the case of using asynchronous mode, you must ensure that each link is using asynchronous, so that your request will not block in At a certain stage, it can be guaranteed that at the same time, Django asynchronous mode can handle more requests