Sync or async? Feel the magic of coroutines and the event loop in Django
summary
Explains how Django apps use asyncio and ASGI to yield during I/O, showing a concrete demo: a NanoDjango app served with Gunicorn handles ~15 concurrent requests, switching only the server to Uvicorn raises throughput to ~250 without code changes. Covers async def/await keywords, event loop behavior, cost of sync/async context switches, partial async ORM and middleware caveats, and recommends converting IO-heavy views first to gain concurrency and better CPU utilization.
AI-written summary · about
chapters (7)
- 0:00Introduction and speaker intro
- 1:17Concurrency vs parallelism explained
- 9:25Coroutines and event loop basics
- 14:56Python asyncio and async/await
- 17:50Async in Django framework
- 22:40Live demo and performance comparison
- 25:14Q&A and closing remarks
related talks
32mAsynchronous Django: Unlocking the Power of Async Programming
23mµDjango, an Asynchronous Microservices Technique with Practical Examples
32mSync vs. Async in Python: Tools, Benchmarks, and ASGI/WSGI Explained
40mTaking Django Async
55mKeynote: The Natural State of Computers
01h 10mJust Add Await: Retrofitting Async Into Django
31mA Really Gentle Introduction to Asyncio
31mHey, Python-Web-Community! What's going on?
