class documentation

WSGI middleware that intercepts calls to a directory, as defined by one of the *_ROOT settings, and serves those files, publishing them under *_URL.

Method __call__ Undocumented
Method __init__ Undocumented
Method file_path Return the relative path to the file on disk for the given URL.
Method get_response Return an HttpResponse object for the given HttpRequest.
Method serve Undocumented
Instance Variable application Undocumented
Instance Variable base_url Undocumented
Method _should_handle 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 BaseHandler (via WSGIHandler):

Method adapt_method_mode 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_response Raise an error if the view returned None or an uncalled coroutine.
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.
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.
Instance Variable _exception_middleware Undocumented
Instance Variable _middleware_chain Undocumented
Instance Variable _template_response_middleware Undocumented
Instance Variable _view_middleware Undocumented
def __call__(self, environ, start_response): (source)
def __init__(self, application): (source)
def file_path(self, url): (source)

Return the relative path to the file on disk for the given URL.

def get_response(self, request): (source)

Return an HttpResponse object for the given HttpRequest.

def serve(self, request): (source)

Undocumented

application = (source)

Undocumented

base_url = (source)

Undocumented

def _should_handle(self, path): (source)

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)