Bird
0
0

You added a custom APIView but the browsable API interface shows a blank page with no JSON or form. What is the likely cause?

medium📝 Debug Q14 of 15
Django - REST Framework Basics
You added a custom APIView but the browsable API interface shows a blank page with no JSON or form. What is the likely cause?
AYou used <code>render()</code> instead of <code>Response()</code> in the view
BYou did not add <code>rest_framework</code> to <code>INSTALLED_APPS</code>
CYou disabled the browsable API in settings
DYou forgot to return a Response object from the view method
Step-by-Step Solution
Solution:
  1. Step 1: Check the view method return type

    The browsable API requires the view to return a Response object from rest_framework.response to render data properly.
  2. Step 2: Understand impact of missing Response

    If the view returns nothing or a wrong type, the browsable API cannot display JSON or forms, resulting in a blank page.
  3. Final Answer:

    You forgot to return a Response object from the view method -> Option D
  4. Quick Check:

    Missing Response return = blank browsable API [OK]
Quick Trick: Always return Response() in APIView methods [OK]
Common Mistakes:
MISTAKES
  • Using Django's render() instead of DRF Response()
  • Not adding rest_framework app (causes different error)
  • Disabling browsable API without realizing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes