v0.131 (2025-03-20)ยค
__
Featยค
-
Support for extensions (plugins) for django-components!
- Hook into lifecycle events of django-components
- Pre-/post-process component inputs, outputs, and templates
- Add extra methods or attributes to Components
- Add custom extension-specific CLI commands
- Add custom extension-specific URL routes
Read more on Extensions.
-
New CLI commands:
components list- List all componentscomponents create <name>- Create a new component (supersedesstartcomponent)components upgrade- Upgrade a component (supersedesupgradecomponent)components ext list- List all extensionscomponents ext run <extension> <command>- Run a command added by an extension
-
@djc_testdecorator for writing tests that involve Components.- The decorator manages global state, ensuring that tests don't leak.
- If using
pytest, the decorator allows you to parametrize Django or Components settings. - The decorator also serves as a stand-in for Django's
@override_settings.
See the API reference for
@djc_testfor more details. -
ComponentRegistrynow has ahas()method to check if a component is registered without raising an error. -
Get all created
Componentclasses withall_components(). -
Get all created
ComponentRegistryinstances withall_registries().
Refactorยค
-
The
startcomponentandupgradecomponentcommands are deprecated, and will be removed in v1.Instead, use
components create <name>andcomponents upgrade.
Internalยค
- Settings are now loaded only once, and thus are considered immutable once loaded. Previously, django-components would load settings from
settings.COMPONENTSon each access. The new behavior aligns with Django's settings.