ASGI (Asynchronous Server Gateway Interface) supports asynchronous features like WebSockets and long-lived connections. WSGI (Web Server Gateway Interface) only handles synchronous HTTP requests.
WSGI does not support WebSocket connections, so the app will reject or fail to handle them.
from django.core.asgi import get_asgi_application application = ???
The correct way to get an ASGI application in Django is to call get_asgi_application(). The other options are either WSGI or invalid.
async def my_view(request): return HttpResponse('Hello async!')
Under WSGI, an async view returns a coroutine object instead of an HttpResponse. Django raises an AttributeError (e.g., 'coroutine' object has no attribute 'status_code'). The view body does not execute.
ASGI uses asynchronous event loops to handle many connections at once without blocking. WSGI processes one request per worker synchronously.