For further details, consult the official Injector documentation . Make Your Django Project Less Confusing with Design Pattern
A guide to implementing injector.py revolves around three main abstractions: injector.py
Instantiate the Injector and use it to retrieve your root object. For further details
from injector import Injector injector = Injector([MyModule()]) # Pass your modules here service = injector.get(Service) # Automatically creates Database and Service print(service.db.status) # "Connected" Use code with caution. Copied to clipboard injector.py