feat(djinit/templates/components): expose configurable app_config_name placeholder in AppConfig template
Allows the generated AppConfig class to use a custom name derived from `app_config_name`, supporting optional `app_module` specification. New Features - Replace `app_name|title` placeholder with `app_config_name` for flexible config naming. - Add conditional block that sets `name` to `app_module` when provided, otherwise falls back to `app_name`. Enhancements - Maintain backward compatibility by defaulting to the original `app_name` behavior. - Improve template flexibility for future naming conventions. Bug Fixes - None.
This commit is contained in:
1 file changed
+7
-1
@@ -1,6 +1,12 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class [[ app_name|title ]]Config(AppConfig):
|
||||
|
||||
class [[ app_config_name ]]Config(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
# @IF app_module
|
||||
name = '[[ app_module ]]'
|
||||
# @ENDIF
|
||||
# @IF not app_module
|
||||
name = '[[ app_name ]]'
|
||||
# @ENDIF
|
||||
Reference in new issue
Block a user