Test your knowledge

  1. Under the hoods, the @api_view decorator is:
    1. A wrapper that converts a function-based view into a subclass of the rest_framework.views.APIView class.
    2. A wrapper that converts a function-based view into a serializer.
    3. A wrapper that converts a function-based view into a subclass of the rest_framework.views.api_view class.

  2. The browsable API, a feature included in Django REST Framework that:
    1. Generates human-friendly JSON output for each resource whenever the request specifies application/json as the value for the Content-type key in the request header.
    2. Generates human-friendly HTML output for each resource whenever the request specifies text/html as the value for the Content-type key in the request header.
    3. Generates human-friendly HTML output for each resource whenever the request specifies application/json as the value for the Content-type key in the request header.

  3. The rest_framework.serializers.ModelSerializer class:
    1. Automatically populates both a set of default constraints and a set of default parsers.
    2. 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 but doesn't automatically populate a set of default validators. Automatically populates both a set of default fields and a set of default validators.

  4. The rest_framework.serializers.ModelSerializer class:
    1. Provides default implementations for the get and patch methods.
    2. Provides default implementations for the get and put methods.
    3. Provides default implementations for the create and update methods.

  5. The Serializer and ModelSerializer classes in Django REST Framework are similar to the following two classes in Django Web Framework:
    1.  Form and ModelForm classes.
    2.  View and ModelView classes.
    3.  Controller and ModelController classes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.127.37