Skip to main content

start_django

Starts a Django application in a dedicated daemon thread and manages its execution lifecycle using a reloader. It ensures terminal echo is enabled and continuously runs the reloader until a stop signal is received.

def start_django(
reloader: object,
main_func: callable,
*args: any,
**kwargs: any
) - > null

Starts the Django application in a dedicated background thread and manages its lifecycle using a reloader mechanism.

Parameters

NameTypeDescription
reloaderobjectThe reloader instance responsible for monitoring file changes and signaling when the process should stop.
main_funccallableThe primary entry point function for the Django application to be executed in the background thread.
*argsanyVariable positional arguments passed directly to the main_func.
**kwargsanyVariable keyword arguments passed directly to the main_func.

Returns

TypeDescription
nullNothing is returned as the function enters a monitoring loop until the reloader signals a stop.