Test your knowledge

Let's see whether you can answer the following questions correctly.

  1. The permissions.SAFE_METHODS tuple of string includes the following HTTP methods or verbs that are considered safe:
    1. 'GET', 'HEAD', and 'OPTIONS'
    2. 'POST', 'PATCH', and 'OPTIONS'
    3. 'GET', 'PUT', and 'OPTIONS'
  2. Which of the following settings key in the REST_FRAMEWORK dictionary specifies the global setting with a tuple of string whose values indicate the classes that we want to use for authentication?
    1. 'GLOBAL_AUTHENTICATION_CLASSES'
    2. 'DEFAULT_AUTHENTICATION_CLASSES'
    3. 'REST_FRAMEWORK_AUTHENTICATION_CLASSES'
  3. Which of the following is the model that persists a Django user?
    1. Django.contrib.auth.DjangoUser
    2. Django.contrib.auth.User
    3. Django.rest-framework.User
  4. Which of the following classes is the base class from which all customized permission classes should inherit to work with the Django REST framework?
    1. Django.contrib.auth.MainPermission
    2. rest_framework.permissions.MainPermission
    3. rest_framework.permissions.BasePermission
  5. In order to configure permission policies for a class-based view, which of the following class attributes do we have to override?
    1. permission_classes
    2. permission_policies_classes
    3. rest_framework_permission_classes

The rights answers are included in the AppendixSolutions.

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

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