File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
2424
2525### Changed
2626
27- - ** Internal** : Refactored application initialization to use internal plugin instead of direct calls in ` AppConfig.ready() ` .
27+ - ** Internal** : Refactored app initialization to use internal plugin for autoconfiguration instead of in ` AppConfig.ready() ` .
2828
2929## [ 0.16.0]
3030
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ class DjangoBirdAppConfig(AppConfig):
1515
1616 @override
1717 def ready (self ):
18+ from django_bird .components import components
1819 from django_bird .conf import app_settings
1920 from django_bird .plugins import pm
21+ from django_bird .staticfiles import asset_types
2022
23+ pm .hook .register_asset_types (register_type = asset_types .register_type )
24+ components .discover_components ()
2125 for init_handler in pm .hook .ready (app_settings = app_settings ):
2226 init_handler ()
Original file line number Diff line number Diff line change 1515from ._typing import override
1616from .utils import unique_ordered
1717
18-
19- @hookimpl
20- def ready (app_settings : AppSettings ):
21- from .components import components
22- from .plugins import pm
23- from .staticfiles import asset_types
24-
25- app_settings .autoconfigure ()
26- pm .hook .register_asset_types (register_type = asset_types .register_type )
27- components .discover_components ()
28-
29-
3018DJANGO_BIRD_SETTINGS_NAME = "DJANGO_BIRD"
3119
3220
@@ -55,6 +43,11 @@ def get_component_directory_names(self):
5543 return unique_ordered ([* self .COMPONENT_DIRS , "bird" ])
5644
5745
46+ @hookimpl
47+ def ready (app_settings : AppSettings ):
48+ app_settings .autoconfigure ()
49+
50+
5851DJANGO_BIRD_BUILTINS = "django_bird.templatetags.django_bird"
5952DJANGO_BIRD_FINDER = "django_bird.staticfiles.BirdAssetFinder"
6053
You can’t perform that action at this time.
0 commit comments