The server and APIs Build step two: the server, the program that receives the interface's requests and answers them. Five lessons: a REST API, doing many things at once, sending data piece by piece, pages built on the server, and a live connection with WebSockets.
Lessons 0 Overview Three lessons about programs that talk to others: a REST API with its requests and codes, then asyncio, which gets many things done on one thread, then async generators, which hand data over piece by piece. 1 RESTful APIs How programs talk to each other over HTTP: you read the REST contract and the protocol basics, consume an API with curl and Python, build one with http.server and then Flask, secure it, and document it with the OpenAPI s 2 Asynchronous Python How your program stops wasting time waiting: you separate waiting from computing, write coroutines with async/await, run dozens of operations together with gather and as_completed, control them as Tasks, and measure the 3 Async Generators & Comprehensions When data arrives piece by piece with a wait between the pieces: you write a generator that combines yield and await in one body, consume it with async for, shrink that to a one-line async comprehension, annotate it with 4 Server-side rendering with Jinja templates The server builds a complete HTML page and sends it ready: templates, inheritance and auto-escaping, Flask as the example, and when to pick SSR over a single-page app. 5 WebSockets: a live two-way connection Why HTTP is not enough for chat and live notifications, the handshake that upgrades the connection, broadcasting to everyone connected, and a small chat server with asyncio. 6 Wrap-up and resources The best outside resources for these lessons, classified by kind and level. All are open to everyone and need no account on any platform. Use the filters to narrow the list.