class documentation
class ASGIStaticFilesHandler(StaticFilesHandlerMixin, ASGIHandler): (source)
ASGI application which wraps another and intercepts requests for static files, passing them off to Django's static file serving.
Async Method | __call__ |
Async entrypoint - parses the request and hands off to get_response. |
Method | __init__ |
Undocumented |
Instance Variable | application |
Undocumented |
Instance Variable | base |
Undocumented |
Inherited from StaticFilesHandlerMixin
:
Method | file |
Return the relative path to the media file on disk for the given URL. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Async Method | get |
Undocumented |
Method | load |
Undocumented |
Method | serve |
Serve the request path. |
Class Variable | handles |
Undocumented |
Method | _should |
Check if the path should be handled. Ignore the path if: * the host is provided as part of the base_url * the request's path isn't under the media path (or equal) |
Inherited from ASGIHandler
(via StaticFilesHandlerMixin
):
Class Method | chunk |
Chunks some data up so it can be sent in reasonable size messages. Yields (chunk, last_chunk) tuples. |
Method | create |
Create the Request object and returns either (request, None) or (None, response) if there is an error response. |
Method | get |
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 |
Last-chance handler for exceptions. |
Async Method | read |
Reads an HTTP body from an ASGI connection. |
Async Method | send |
Encode and send a response out over ASGI. |
Class Variable | chunk |
Undocumented |
Inherited from BaseHandler
(via StaticFilesHandlerMixin
, ASGIHandler
):
Method | adapt |
Adapt a method to be in the correct "mode": - If is_async is False: - Synchronous methods are left alone - Asynchronous methods are wrapped with async_to_sync - If is_async is True: - Synchronous methods are wrapped with sync_to_async() - Asynchronous methods are left alone... |
Method | check |
Raise an error if the view returned None or an uncalled coroutine. |
Method | make |
Undocumented |
Method | process |
Pass the exception to the exception middleware. If no middleware return a response for this exception, return None. |
Method | resolve |
Retrieve/set the urlconf for the request. Return the view resolved, with its args and kwargs. |
Method | _get |
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 |
Resolve and call the view, then apply view, exception, and template_response middleware. This method is everything that happens inside the request/response middleware. |
Instance Variable | _exception |
Undocumented |
Instance Variable | _middleware |
Undocumented |
Instance Variable | _template |
Undocumented |
Instance Variable | _view |
Undocumented |