Module quiz: Securing an API in Django REST framework

A passionate full-stack developer from @ePlus.DEV
Search for a command to run...

A passionate full-stack developer from @ePlus.DEV
No comments yet. Be the first to comment.
Quick and practical tips to help users optimize tasks, improve skills, and solve common problems effectively across various areas like tech, lifestyle, productivity, and more.
Overview In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to

🏕️ Arcade Base Camp August 2026 Welcome to Arcade Base Camp August 2026, where you’ll develop key Google Cloud skills and earn an exclusive credential that will open doors to the cloud for you. No pr

Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary Google Cloud giới thiệu hai Database Operations Agents hỗ trợ onboard

Một bản tin giúp Developer cập nhật nhanh AI, Cloud, Open Source và những công nghệ đáng chú ý trong ngày. 📌 Executive Summary SK hynix và Sandisk công bố đặc tả mở đầu tiên cho High Bandwidth Fla

Challenge overview In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure

In what way can you validate the price field to not be less than 5 in a serializer? Choose all that apply.
By using a validate method
By adding this line of code in the serializer:
price = serializers.DecimalField(max_digits=6, decimal_places=2, min_value=5)
By using a validate_price_lt method
By using a validation method
By adding
'price': {'min_value': 5} in the extra_kwargs section
How can you limit an API endpoint in such a way that only POST, PUT, PATCH and DELETE calls will be throttled, but GET calls will not be throttled? Choose all that apply.
By writing a custom throttle class and overriding the get_throttles method
By writing a custom throttle class and using it inside a @throttle_classes decorator.
By writing a scoped throttle class and set it up in the settings.py file
This cannot be done
For token-based authentication, you need to install the Djoser library because DRF doesn’t support such authentications by default.
True
False
How can you enable support for sorting the API output by two fields: age and gender?
By manually parsing the query string
By adding this line of code
ordering_fields=['age','gender'] in a class-based view
By adding this @ordering_fields(['age','gender']) above a function-based view
No code change is required. Just add ‘OrderingFilter' in the settings.py file and DRF will process it automatically.
Which of the following are valid endpoints automatically created by Djoser?
/users/
/users/me/
/user/confirm/
/user/me/
/user/
You can manually expire a JWT access token any time you want.
True
False
How can you assign users to a user group? Choose all that apply.
From the Django admin panel
By making a call to /users/groups endpoint
Using Djoser library
By using the user_set.add() method in a Group object
By manually modifying the database records
Which of the following prefixes should you use to successfully authenticate a token using SimpleJWT library?
Auth Token
Token
Auth
Bearer
What happens when you blacklist a JWT refresh token?
It cannot be used to generate new refresh tokens
It blocks the user who bears this token
It expires
It cannot be used to generate new access tokens anymore.
It also blacklists the access token
Which of the following prefixes must you use with tokens to successfully authenticate an API call in plain DRF?
Auth
Auth Token
Bearer
Token
Which external package can you use to sanitize HTML tags from user input data?
Cleaner
Bleach
Sanitizer
