Whatever your control command does, abstract it from one function and call that function with django.utils.autoreload.main
from django.utils import autoreload def do_something(*args, **kwargs):
For Django 2.2 or higher use
autoreload.run_with_reloader(do_something, args=None, kwargs=None)
source share