fix linter errors
This commit is contained in:
parent
40e39efa37
commit
3e2704f870
@ -17,7 +17,7 @@ logger = get_logger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class ASGIAppLoader:
|
class ASGIAppLoader:
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self._apps: Dict[str, ASGIApp] = {}
|
self._apps: Dict[str, ASGIApp] = {}
|
||||||
self._wsgi_adapters: Dict[str, ASGIApp] = {}
|
self._wsgi_adapters: Dict[str, ASGIApp] = {}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ class ASGIAppLoader:
|
|||||||
logger.info(f"Wrapped WSGI app: {app_path}")
|
logger.info(f"Wrapped WSGI app: {app_path}")
|
||||||
|
|
||||||
self._apps[app_path] = app
|
self._apps[app_path] = app
|
||||||
return app
|
return cast(ASGIApp, app)
|
||||||
|
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.error(f"Failed to import application {app_path}: {e}")
|
logger.error(f"Failed to import application {app_path}: {e}")
|
||||||
@ -137,7 +137,7 @@ class MountedApp:
|
|||||||
|
|
||||||
|
|
||||||
class ASGIMountManager:
|
class ASGIMountManager:
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
self._mounts: list[MountedApp] = []
|
self._mounts: list[MountedApp] = []
|
||||||
self._loader = ASGIAppLoader()
|
self._loader = ASGIAppLoader()
|
||||||
|
|
||||||
@ -288,8 +288,8 @@ def create_django_app(
|
|||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from django.core.asgi import get_asgi_application
|
from django.core.asgi import get_asgi_application # type: ignore[import-untyped]
|
||||||
return get_asgi_application()
|
return cast(ASGIApp, get_asgi_application())
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.error(f"Failed to load Django application: {e}")
|
logger.error(f"Failed to load Django application: {e}")
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user