Since runserver is started by an atexit-hook, the application module is not in sys.modules.
Specifying no_atexit=True and starting server in a if __name__ == "__main__"-clause _handle_management_command("runserver") works as intended.
As awesome as I find the atexit idea, I am not sure, if a more flasky approach with explicit app start would be more useful (and, maybe, more pythonic).
Since runserver is started by an atexit-hook, the application module is not in
sys.modules
.Specifying no_atexit=True and starting server in a
if __name__ == "__main__"
-clause_handle_management_command("runserver")
works as intended.As awesome as I find the atexit idea, I am not sure, if a more flasky approach with explicit app start would be more useful (and, maybe, more pythonic).