To accept a
GET, PUT, POST
andDELETE
call, which generic view do you need to extend in your class-based view?RetrieveUpdateDestroyAPIView
CreateAPIView
RetrieveUpdateAPIView
ListCreateAPIView
Which of the following decorator functions can be used to display the browsable API view from a function-based view?
No decorator is needed, DRF handles this automatically.
throttle_classes() decorator
api_view() decorator
permission_classes() decorator
A model has two fields –
id
andtitle
. When linked from the serializers, this model always shows the value of the id field. To display the value of thetitle
field instead of theid
field, you need to override the __________ method inside the model class.str
id
repr
title
This is not possible
PascaleCase is the ideal naming convention for writing API endpoint names.
True
False
How can you keep project dependencies isolated from other projects and avoid conflicts?
Use a virtual environment
Use a Piplock file
Use a global environment
Use a requirements.txt file
Which signing mechanism is used to sign an API call?
TOKEN
JWT
HMAC
SHA
A watchlist is used to pause the code execution on a specific line and check the values of the current variables.
True
False
Djoser automatically creates authentication and authorization API endpoints in the DRF based API projects.
True
False
You are working on a project where the API client needs to send two fields with their values –
email
andconfirmation_email
. As an API developer, you need to check if the value for both these fields are the same before saving the email address in the database. How can you do that? Choose all that apply.This can be done using the
UniqueTogetherValidator
class in the modelThis can be done using the
UniqueTogetherValidator
class in the serializerThis can be done using the
UniqueTogetherValidator
class in the view fileThis can be done using the
UniqueValidator
class in the serializerThis can be done in the serializer by using the
validate()
method
What are the benefits of caching? Choose all that apply.
Less load on the database
Increased security
Save bandwidth and network resources
Less load on the web server
Reduced infrastructure bills