class BaseHandler:
Known subclasses: django.core.handlers.asgi.ASGIHandler
, django.core.handlers.wsgi.WSGIHandler
, django.test.client.AsyncClientHandler
, django.test.client.ClientHandler
Undocumented
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 |
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
django.test.testcases.FSFilesHandler
Asynchronous version of get_response.
Funneling everything, including WSGI, into a single async get_response() is too slow. Avoid the context switch by using a separate async response path.
Populate middleware lists from settings.MIDDLEWARE.
Must be called after the environment is fixed (see __call__ in subclasses).