Skip to content

Django

Classes

WireupSettings dataclass

Class containing Wireup settings specific to Django.

Attributes

auto_inject_views: bool = True class-attribute instance-attribute

Whether to automatically inject dependencies into Django views.

When True (default), Wireup will automatically inject dependencies into all Django views. When False, you must use the @inject decorator explicitly on views that need injection.

Set this to False if you want to use @inject explicitly across all views (useful when mixing core Django views with third-party views like Django REST framework).

service_modules: List[Union[str, ModuleType]] instance-attribute

List of modules containing wireup service registrations.

Functions

get_app_container()

Return the container instance associated with the current django application.

get_request_container()

When inside a request, returns the scoped container instance handling the current request.