Skip to content

runner

dev_tool.services.django.runner

ServerRunner

Bases: Protocol

A protocol for server runners.

run

A method that starts the server.

Source code in dev_tool/services/django/runner.py
def run(self) -> None:
    """A method that starts the server."""
    ...

stop

A method that stops the server.

Source code in dev_tool/services/django/runner.py
def stop(self) -> None:
    """A method that stops the server."""
    ...

DjangoServerRunner

Bases: BaseProcessRunner

A class for running a Django development server.

This class handles starting, monitoring, and stopping a Django server process in both local and containerized environments.

The constructor for the DjangoServerRunner class.

Parameters:

  • project_name (str) –

    The project name for container naming.

  • ip_address (str) –

    The IP address to bind to.

  • port (int) –

    The port number to bind to.

Source code in dev_tool/services/django/runner.py
def __init__(self, project_name: str, ip_address: str, port: int) -> None:
    """
    The constructor for the DjangoServerRunner class.

    :param project_name: The project name for container naming.
    :param ip_address: The IP address to bind to.
    :param port: The port number to bind to.
    """

    super().__init__(project_name=project_name)

    self.ip_address = ip_address
    self.port = port

ip_address = ip_address instance-attribute

port = port instance-attribute