Skip to main content

restart_with_reloader

Restarts the current process in a subprocess with an environment variable indicating the reloader is active, while preserving unbuffered output settings and looping until a non-reload return code is received.

def restart_with_reloader() - > int

Restarts the current process in a subprocess with the Django autoreload environment variable set, effectively starting the file watcher loop. It manages the lifecycle of the child process, automatically restarting it if it exits with a return code of 3.

Returns

TypeDescription
intThe exit code of the child process when it terminates with a code other than 3.