I overrode BaseCommand to create my own management command, as documented here. It's a long-running process though, and I want to be able to interrupt it and have it gracefully shut down when I send it ctrl+c.
I tried the usual signal.signal(signal.SIGINT, signal_handler), but the signal_handler never gets called. Django seems to have its own signal handling system, but I made responders for the three django.core.signals: got_request_exception, request_finished, and request_started but none of those get called either.