Bird
0
0

You want to customize the browsable API interface to show a custom logo and description. Which approach is correct?

hard📝 Conceptual Q8 of 15
Django - REST Framework Basics
You want to customize the browsable API interface to show a custom logo and description. Which approach is correct?
AAdd a static image URL in the serializer class
BChange DEFAULT_RENDERER_CLASSES to a custom renderer class only
CModify the APIView class to add logo HTML in the response
DOverride the default template 'rest_framework/api.html' in your project templates
Step-by-Step Solution
Solution:
  1. Step 1: Understand browsable API customization

    The browsable API uses templates. Overriding 'rest_framework/api.html' lets you customize layout and add logos.
  2. Step 2: Evaluate other options

    Changing renderer class alone won't add logos. APIView and serializer changes do not affect browsable API templates.
  3. Final Answer:

    Override the default template 'rest_framework/api.html' in your project templates -> Option D
  4. Quick Check:

    Customize browsable API via template override [OK]
Quick Trick: Customize browsable API by overriding its template [OK]
Common Mistakes:
MISTAKES
  • Trying to add logos via serializers or views
  • Changing renderer classes without templates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes