resolver
django_spire.core.management.commands.spire_startapp_pkg.resolver
PathResolver
Resolves file system paths for app and template creation.
This class determines where new Django apps and their templates should be created based on project structure and configuration.
Initializes the path resolver with base directories.
Parameters:
-
base_dir(Path | None, default:None) –Optional base directory for the Django project (defaults to settings.BASE_DIR).
-
template_dir(Path | None, default:None) –Optional template directory (defaults to base_dir/templates).
Source code in django_spire/core/management/commands/spire_startapp_pkg/resolver.py
get_app_destination
Gets the destination path for a new app based on its components.
For components ['app', 'human_resource', 'employee'], returns Path('base_dir/app/human_resource/employee').
Parameters:
Returns:
-
Path–Full path where the app should be created.
Source code in django_spire/core/management/commands/spire_startapp_pkg/resolver.py
get_base_dir
get_template_destination
Gets the destination path for templates based on app components.
Excludes the first component (root app) from the path. For components ['app', 'human_resource', 'employee'], returns Path('templates/human_resource/employee').
Parameters:
Returns:
-
Path–Full path where templates should be created.
Source code in django_spire/core/management/commands/spire_startapp_pkg/resolver.py
get_template_dir
Gets the project's template directory.
Returns:
-
Path–Template directory path for the Django project.