Introduction to Dependency Injection In FastAPI

preview_player
Показать описание
This is a very simple Introduction to Dependency Injection In FastAPI. FastAPI relies on dependency injection to effectively manage dependencies for route handlers and components, offering a clean and modular approach within your application. This system allows you to inject resources like database connections or authentication services into routes, ensuring a focused and organized code structure. By separating concerns, route handlers concentrate on request handling, while dependencies are independently provided and managed.

GITHUB:

TWITTER:

TIMESTAMPS:
(00:00:00) Intro
(00:02:07) Project structure
(00:02:51) Running the project
(00:03:57) Create your first dependency
(06:00:50) Inject the dependency into a route handler
(00:10:39) A simple demo on Swagger UI
(00:12:26) Sharing the dependency across other routes
(00:16:10) Using class dependencies
(00:20:30) Conclusion
Рекомендации по теме
Комментарии
Автор

Hi everyone, I am cooking up a course on this topic.

SsaliJonathan
Автор

good stuff.
I highly request you to make a video regarding Dependency Injection of database connection with fastApi and SQLmodel. how it internally use single connection to handle multiple db query. please make a video regarding this 🙏🙏🙏🙏🙏

Rejuyan-Ahmed
Автор

Please do make some advance content like realtime stuff with redis or any message broker

nehat