hi,
I checked the source code for Daphne, it uses import_by_path to import application
def import_by_path(path):
"""
Given a dotted/colon path, like project.module:ClassName.callable,
returns the object at the end of the path.
"""
module_path, object_path = path.split(":", 1)
target = importlib.import_module(module_path)
for bit in object_path.split("."):
target = getattr(target, bit)
return target
In linux, we can use command like 'cd path && daphne project.asgi:application' to run the application in any path, but I don't know if windows support it.