MCPcopy
hub / github.com/django/django / run_with_reloader

Function run_with_reloader

django/utils/autoreload.py:681–694  ·  view source on GitHub ↗
(main_func, *args, **kwargs)

Source from the content-addressed store, hash-verified

679
680
681def run_with_reloader(main_func, *args, **kwargs):
682 signal.signal(signal.SIGTERM, lambda *args: sys.exit(0))
683 try:
684 if os.environ.get(DJANGO_AUTORELOAD_ENV) == "true":
685 reloader = get_reloader()
686 logger.info(
687 "Watching for file changes with %s", reloader.__class__.__name__
688 )
689 start_django(reloader, main_func, *args, **kwargs)
690 else:
691 exit_code = restart_with_reloader()
692 sys.exit(exit_code)
693 except KeyboardInterrupt:
694 pass

Callers

nothing calls this directly

Calls 5

get_reloaderFunction · 0.85
start_djangoFunction · 0.85
restart_with_reloaderFunction · 0.85
infoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected