runner
dev_tool.services.django.runner
log = logging.getLogger(__name__)
module-attribute
ServerRunner
Bases: Protocol
A protocol for server runners.
run
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
ip_address = ip_address
instance-attribute
port = port
instance-attribute
GunicornServerRunner
Bases: BaseProcessRunner
A class for running a Gunicorn server inside a container.
This class handles starting, monitoring, and stopping a Gunicorn process using the project's gunicorn.conf.py configuration file. A temporary WSGI wrapper module is created in the container to serve static files via Django's StaticFilesHandler.
The constructor for the GunicornServerRunner class.
Parameters:
-
project_name(str) –The project name for container naming.
-
port(int) –The port number to bind to.
-
wsgi_app(str) –The WSGI application module path in gunicorn format.
-
wrapper_content(str) –The rendered WSGI wrapper module content.