@api_view
decorator is:rest_framework.views.APIView
class.rest_framework.views.api_view
class.
application/json
as the value for the Content-type
key in the request header.text/html
as the value for the Content-type
key in the request header.application/json
as the value for the Content-type
key in the request header.
rest_framework.serializers.ModelSerializer
class:
Automatically populates both a set of default fields but doesn't automatically populate a set of default validators. Automatically populates both a set of default fields and a set of default validators.
rest_framework.serializers.ModelSerializer
class:get
and patch
methods.get
and put
methods.create
and update
methods.
Serializer
and ModelSerializer
classes in Django REST Framework are similar to the following two classes in Django Web Framework:Form
and ModelForm
classes.View
and ModelView
classes.Controller
and ModelController
classes.
3.133.127.37