What is the use of the “urlpatterns” list in Django?

What is the use of the “urlpatterns” list in Django?

a) To manage the database schema
b) To define the mapping between URLs and views
c) To configure static files
d) To list installed apps

Answer:

b) To define the mapping between URLs and views

Explanation:

The urlpatterns list in Django is used to map URL patterns to specific view functions or classes, determining how URLs are routed to views in the app.

Reference:

Django Quiz – MCQ Questions and Answers

Scroll to Top