Bird
0
0

Which of the following is the correct way to add the browsable API renderer in Django REST Framework settings?

easy📝 Syntax Q3 of 15
Django - REST Framework Basics
Which of the following is the correct way to add the browsable API renderer in Django REST Framework settings?
AREST_FRAMEWORK = { 'RENDERERS': ['BrowsableAPIRenderer'] }
BREST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ['rest_framework.renderers.BrowsableAPIRenderer'] }
CREST_FRAMEWORK = { 'API_RENDERER': ['BrowsableAPIRenderer'] }
DREST_FRAMEWORK = { 'DEFAULT_RENDERER': ['BrowsableAPIRenderer'] }
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct setting key and value format

    The correct key is DEFAULT_RENDERER_CLASSES and the value is a list of full renderer class paths.
  2. Step 2: Check each option's syntax

    Only REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ['rest_framework.renderers.BrowsableAPIRenderer'] } uses the correct key and full class path string. Others use incorrect keys or incomplete values.
  3. Final Answer:

    REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ['rest_framework.renderers.BrowsableAPIRenderer'] } -> Option B
  4. Quick Check:

    Correct key and full class path = REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ['rest_framework.renderers.BrowsableAPIRenderer'] } [OK]
Quick Trick: Use DEFAULT_RENDERER_CLASSES with full class path [OK]
Common Mistakes:
MISTAKES
  • Using wrong setting keys like RENDERERS or API_RENDERER
  • Omitting full module path for renderer class

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes