django_prodserver.management package

Subpackages

Submodules

django_prodserver.management.base module

class django_prodserver.management.base.BaseProcessCommand(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: BaseCommand

Shared implementation behind the server and worker commands.

Subclasses select which kind of process they manage by setting process_label (used in user-facing messages) and backend_base_class (the base class a configured backend must subclass to be runnable by the command).

add_arguments(parser: ArgumentParser) None[source]

Add arguments.

backend_base_class

Backends configured for this command must subclass this class.

alias of BaseProcessBackend

list_process_names() None[source]

Simple function to return a list of the configured processes.

process_label: str = 'process'

Human readable noun for the kind of process managed (e.g. "server").

run_from_argv(argv: list[str]) None[source]

Slight modification of the BaseCommand function.

Set up any environment changes requested (e.g., Python path and Django settings), then run this command. If the command raises a CommandError, intercept it and print it sensibly to stderr. If the --traceback option is present or the raised Exception is not CommandError, raise it.

start_process(process_name: str, *args: list[str], **kwargs: Mapping[str, str]) None[source]

Start the correct process based on the provided name.