11from collections .abc import Awaitable , Callable , Iterator , Mapping , Sequence
2+ from logging import Logger
23from typing import IO , Any , TypeVar
34
45from django .core .handlers import base
@@ -13,6 +14,10 @@ _ReceiveCallback: TypeAlias = Callable[[], Awaitable[Mapping[str, Any]]]
1314
1415_SendCallback : TypeAlias = Callable [[Mapping [str , Any ]], Awaitable [None ]]
1516
17+ logger : Logger
18+
19+ def get_script_prefix (scope : Mapping [str , Any ]) -> str : ...
20+
1621class ASGIRequest (HttpRequest ):
1722 body_receive_timeout : int
1823 scope : Mapping [str , Any ]
@@ -42,6 +47,11 @@ class ASGIHandler(base.BaseHandler):
4247 receive : _ReceiveCallback ,
4348 send : _SendCallback ,
4449 ) -> None : ...
50+ async def handle (
51+ self , scope : dict [str , Any ], receive : _ReceiveCallback , send : _SendCallback
52+ ) -> HttpResponseBase | None : ...
53+ async def listen_for_disconnect (self , receive : _ReceiveCallback ) -> None : ...
54+ async def run_get_response (self , request : HttpRequest ) -> HttpResponseBase : ...
4555 async def read_body (self , receive : _ReceiveCallback ) -> IO [bytes ]: ...
4656 def create_request (
4757 self , scope : Mapping [str , Any ], body_file : IO [bytes ]
@@ -52,4 +62,3 @@ class ASGIHandler(base.BaseHandler):
5262 async def send_response (self , response : HttpResponseBase , send : _SendCallback ) -> None : ...
5363 @classmethod
5464 def chunk_bytes (cls , data : Sequence [_T ]) -> Iterator [tuple [Sequence [_T ], bool ]]: ...
55- def get_script_prefix (self , scope : Mapping [str , Any ]) -> str : ...
0 commit comments