Bird
0
0

Given this urls.py snippet, what does it enable?

medium📝 component behavior Q13 of 15
Django - REST Framework Basics
Given this urls.py snippet, what does it enable?
from django.urls import path, include

urlpatterns = [
    path('api-auth/', include('rest_framework.urls')),
]
AIt registers all API views automatically
BIt adds API login and logout pages for DRF's browsable API
CIt disables Django admin interface
DIt sets up database migrations for DRF
Step-by-Step Solution
Solution:
  1. Step 1: Understand the included URL

    The rest_framework.urls include login and logout views for the browsable API.
  2. Step 2: Recognize the effect on API interface

    This enables users to log in and out when using the DRF web interface.
  3. Final Answer:

    It adds API login and logout pages for DRF's browsable API -> Option B
  4. Quick Check:

    Including rest_framework.urls = API login/logout [OK]
Quick Trick: Including rest_framework.urls adds API login/logout pages [OK]
Common Mistakes:
MISTAKES
  • Thinking it registers API views automatically
  • Confusing it with admin site URLs
  • Assuming it runs migrations or database setup

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes