class documentation

class ASGIHandler(base.BaseHandler):

Known subclasses: django.contrib.staticfiles.handlers.ASGIStaticFilesHandler

View In Hierarchy

Handler for ASGI requests.
Class Method chunk​_bytes Chunks some data up so it can be sent in reasonable size messages. Yields (chunk, last_chunk) tuples.
Async Method __call__ Async entrypoint - parses the request and hands off to get_response.
Method __init__ Undocumented
Method create​_request Create the Request object and returns either (request, None) or (None, response) if there is an error response.
Method get​_script​_prefix Return the script prefix to use from either the scope or a setting.
Async Method handle Handles the ASGI request. Called via the __call__ method.
Method handle​_uncaught​_exception Last-chance handler for exceptions.
Async Method read​_body Reads an HTTP body from an ASGI connection.
Async Method send​_response Encode and send a response out over ASGI.
Class Variable chunk​_size Undocumented

Inherited from BaseHandler:

Method ​_get​_response Resolve and call the view, then apply view, exception, and template_response middleware. This method is everything that happens inside the request/response middleware.
Async Method ​_get​_response​_async Resolve and call the view, then apply view, exception, and template_response middleware. This method is everything that happens inside the request/response middleware.
Method adapt​_method​_mode No summary
Method check​_response Raise an error if the view returned None or an uncalled coroutine.
Method get​_response Return an HttpResponse object for the given HttpRequest.
Async Method get​_response​_async Asynchronous version of get_response.
Method load​_middleware Populate middleware lists from settings.MIDDLEWARE.
Method make​_view​_atomic Undocumented
Method process​_exception​_by​_middleware Pass the exception to the exception middleware. If no middleware return a response for this exception, return None.
Method resolve​_request Retrieve/set the urlconf for the request. Return the view resolved, with its args and kwargs.
Instance Variable ​_exception​_middleware Undocumented
Instance Variable ​_middleware​_chain Undocumented
Instance Variable ​_template​_response​_middleware Undocumented
Instance Variable ​_view​_middleware Undocumented
@classmethod
def chunk_bytes(cls, data):
Chunks some data up so it can be sent in reasonable size messages. Yields (chunk, last_chunk) tuples.
async def __call__(self, scope, receive, send):
Async entrypoint - parses the request and hands off to get_response.
def __init__(self):
def create_request(self, scope, body_file):
Create the Request object and returns either (request, None) or (None, response) if there is an error response.
def get_script_prefix(self, scope):
Return the script prefix to use from either the scope or a setting.
async def handle(self, scope, receive, send):
Handles the ASGI request. Called via the __call__ method.
def handle_uncaught_exception(self, request, resolver, exc_info):
Last-chance handler for exceptions.
async def read_body(self, receive):
Reads an HTTP body from an ASGI connection.
async def send_response(self, response, send):
Encode and send a response out over ASGI.
chunk_size =

Undocumented