def _forward_to_django_shutdown_signal(signal, frame):
    my_django_shutdown_signal.send('system')
sys.exit(0)
signal.signal(signal.SIGINT, _forward_to_django_shutdown_signal)
Django Framework - Is there a shutdown event that can be subscribed to?