Python and FastAPI
Module 23 · Dependency injection and application structure
Dependency injection from first principles, Depends in depth, routers, middleware, lifespan, configuration and real project layouts.
7 lessons
Follow in order
Use the button below to sign in and unlock lessons.
Your path
Lessons in sequence
Work through these in order—each lesson builds on the previous one.
-
Lesson 1 of 7
23.1 Dependency injection from scratch
-
Lesson 2 of 7
23.2 Depends, sub-dependencies and caching
-
Lesson 3 of 7
23.3 Dependencies with yield and cleanup
-
Lesson 4 of 7
23.4 APIRouter and modular projects
-
Lesson 5 of 7
23.5 Middleware, CORS and request hooks
-
Lesson 6 of 7
23.6 Lifespan, startup/shutdown and application state
-
Lesson 7 of 7
23.7 Configuration, environments and a production project layout