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
AsyncAPIView ¶
Bases: APIViewHelpersMixin, APIView
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.
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
¶
Returns a serializer with the request data validated, awaiting ais_valid when available.
aserialized_response
async
¶
aserialized_response(
instance,
*,
many=False,
status=status.HTTP_200_OK,
serializer_class=None,
post_fetches=None,
headers=None,
)
Returns a Response containing the serialized instance, awaiting any post-fetch helpers.
apaginated_response
async
¶
apaginated_response(
queryset,
*,
serializer_class=None,
pagination_class=None,
post_fetches=None,
headers=None,
)
Returns a paginated Response for the given queryset, using async paginator hooks when available.