APIView¶
Base APIView classes with serializer and pagination helpers. See the APIView guide for the dispatch loop and helper method surface.
APIView ¶
Bases: APIViewHelpersMixin, APIView
options ¶
Handles the OPTIONS request, tolerating views without a serializer_class.
AsyncAPIView ¶
Bases: APIViewHelpersMixin, APIView
dispatch
async
¶
Async equivalent of APIView.dispatch.
options
async
¶
Async equivalent of APIView.options. Metadata generation inspects the serializer and can reach the database, so it runs in a thread instead of on the event loop.
ainitial
async
¶
Runs anything that needs to occur prior to calling the method handler.
aperform_authentication
async
¶
Performs authentication on the incoming request.
acheck_permissions
async
¶
Checks if the request should be permitted, raising on failure.
acheck_object_permissions
async
¶
Checks if the request should be permitted for a given object.
acheck_throttles
async
¶
Checks the throttles on the incoming request.
ahandle_exception
async
¶
Handles any exception that occurs, by returning an appropriate response, or re-raising the error.
afinalize_response
async
¶
Returns the final response object after any processing.
avalidated_serializer
async
¶
avalidated_serializer(
*,
data: Any = None,
serializer_class: type[BaseSerializer[Any]]
| None = None,
**kwargs: Any,
) -> BaseSerializer[Any]
Returns a serializer with the request data validated, awaiting ais_valid when available.
aserialized_response
async
¶
aserialized_response(
instance: Any,
*,
many: bool = False,
status: int = status.HTTP_200_OK,
serializer_class: type[BaseSerializer[Any]]
| None = None,
post_fetches: Any = None,
headers: Any = None,
) -> Response
Returns a Response containing the serialized instance, awaiting any post-fetch helpers.
apaginated_response
async
¶
apaginated_response(
queryset: Any,
*,
serializer_class: type[BaseSerializer[Any]]
| None = None,
pagination_class: type[BasePagination] | None = None,
post_fetches: Any = None,
headers: Any = None,
) -> Response
Returns a paginated Response for the given queryset, using async paginator hooks when available.