config
django_spire.core.management.commands.spire_startapp_pkg.config
PathConfig
dataclass
Configuration for template directory paths.
This class holds the paths to the app and HTML template directories used for generating new Django apps.
app_template
instance-attribute
html_template
instance-attribute
default
classmethod
Creates a default PathConfig with standard template locations.
Returns:
-
PathConfig–PathConfig instance with paths to default app and HTML templates.
Source code in django_spire/core/management/commands/spire_startapp_pkg/config.py
AppConfig
dataclass
Configuration for a new Django app being created.
This class contains all the information needed to generate a new app, including its name, path, components, destinations, and user-provided inputs.
app_name
instance-attribute
app_path
instance-attribute
components
instance-attribute
destination
instance-attribute
template_destination
instance-attribute
user_inputs
instance-attribute
app_label
property
Gets the Django app label.
Returns:
-
str–The app label, either from user input or derived from app name.
model_name
property
Gets the model class name.
Returns:
-
str–The model name, either from user input or TitleCase version of app name.
AppConfigFactory
Factory class for creating AppConfig instances.
This class handles the creation of AppConfig objects by resolving paths and processing user inputs.
Initializes the factory with a path resolver.
Parameters:
-
path_resolver(PathResolver) –Path resolver for determining file system locations.
Source code in django_spire/core/management/commands/spire_startapp_pkg/config.py
create_config
Creates an AppConfig from an app path and user inputs.
Parameters:
-
app_path(str) –Dot-separated app path (e.g., 'app.human_resource.employee').
-
user_inputs(dict[str, str]) –Dictionary of user-provided configuration values.
Returns:
-
AppConfig–Configured AppConfig instance ready for app generation.