home
dev_tool.commands.home
log = logging.getLogger(__name__)
module-attribute
HomeCommandGroup
Bases: CommandGroup
A command group for the most common development commands.
This class provides quick access to the most frequently used commands across Django, Python, and database operations.
The constructor for the HomeCommandGroup class.
This method initializes the command group with required services and registers all command methods.
Parameters:
-
django(DjangoService) –The Django service for Django operations.
-
docker(DockerService) –The Docker service for container management.
-
portal(PortalService) –The Portal service for API integration.
-
postgres(PostgresService) –The PostgreSQL service for database operations.
-
python(PythonService) –The Python service for Python operations.
Source code in dev_tool/commands/home.py
django = django
instance-attribute
docker = docker
instance-attribute
portal = portal
instance-attribute
postgres = postgres
instance-attribute
python = python
instance-attribute
__str__
The string representation of the command group.
This method returns the category name for the command group.
Returns:
-
str–The category name as a string.
run_server
A command that starts the Django development server on localhost.
This command ensures the database container is running and then starts the Django development server on 127.0.0.1:8000.
Source code in dev_tool/commands/home.py
rebuild_environment
A method that (re)builds the development environment.
This method sets up environment variables, rebuilds the Python virtual environment, ensures database containers are running, and configures the database with optional seeding and dumping.
Source code in dev_tool/commands/home.py
run_migrations
A command that applies Django migrations.
This command ensures the database container is running and then runs the Django migrate commands for specified apps.
Source code in dev_tool/commands/home.py
install_dependencies
A command that installs and upgrades Python dependencies.
This command runs the Python service's install_dependencies method to update all dependencies defined in requirements files.
Source code in dev_tool/commands/home.py
flush_and_seed
A command that flushes and seeds the database.
This method flushes all data from the database and then runs the Django seeding process, optionally creating superusers afterward.
Source code in dev_tool/commands/home.py
download_environment_variables
A command that downloads environment variables for the current project.
This method uses the project name from the project's pyproject.toml and downloads the environment variables from the portal as a background task.