lback.commands package
This file serves as the initialization point for the ‘lback_framework/lback/commands’ package. It is designed to expose the core components necessary for executing various command-line utilities and management tasks within the Lback web framework. This package centralizes the definition and management of administrative and development-related commands, allowing developers to interact with the framework from the terminal.
—
Key Components Exposed by this Package:
AdminCommands (from .admin): A collection of command-line utilities specifically designed for administrative tasks. These commands typically facilitate the management of the Lback admin interface, such as creating superusers, managing admin configurations, or performing other admin-specific operations from the terminal.
AppCommands (from .app): A set of command-line utilities related to managing individual applications or modules within the Lback project. These commands might include functionalities for creating new app templates, managing app-specific configurations, or performing operations relevant to the lifecycle of an application.
setup_database_and_defaults (from .db_seed): A function or utility responsible for seeding the database with initial data or default configurations. This command is crucial for setting up a fresh development environment or for populating a database with essential data required for the application to function correctly (e.g., default user roles, initial settings).
MigrationCommands (from .migration): A collection of command-line utilities for managing database schema migrations. These commands typically integrate with a migration tool (like Alembic) to create new migration scripts, apply pending migrations to the database, or revert previous migrations, ensuring database schema changes are managed in a version-controlled manner.
ProjectCommands (from .project): A set of command-line utilities related to managing the overall Lback project. These commands might include functionalities for initializing a new Lback project, setting up project-wide configurations, or performing operations relevant to the entire project’s structure and environment.
RunnerCommands (from .runner): A collection of command-line utilities for running the Lback application or specific development servers. This typically includes commands to start the development server, run tests, or execute other processes necessary for developing and deploying the Lback application.
Submodules
lback.commands.admin module
- class lback.commands.admin.AdminCommands[source][source]
Bases:
objectCommand-line utilities for administrative tasks, interacting with the database using the new system.
lback.commands.app module
lback.commands.db_seed module
lback.commands.migration module
- class lback.commands.migration.MigrationCommands(config=None)[source][source]
Bases:
objectProvides command-line interface commands for managing database migrations using Alembic. Wraps Alembic subprocess calls and integrates SignalDispatcher to emit events.
- __init__(config=None)[source][source]
Initializes MigrationCommands. Emits ‘migration_commands_initialized’ signal.
- history()[source][source]
Shows the migration history using Alembic. Emits ‘migration_history_command’ signal.
- makemigrations(message: str = 'auto')[source][source]
Creates a new migration script based on model changes using Alembic. Emits ‘migration_makemigrations_command’ signal.
lback.commands.project module
lback.commands.runner module
- class lback.commands.runner.RunnerCommands[source][source]
Bases:
object- collectstatic(static_dirs=None, output_dir='staticfiles')[source][source]
Collect static files into a single directory.