1. Home
  2. Computer Science MCQs
  3. Django
  4. Which file is used to define URL patterns in Django?

Added 31 Jan 2024

Which file is used to define URL patterns in Django?

  1. urls.py Correct answer
  2. routes.py
  3. patterns.py
  4. web.py

Correct answer

A. urls.py

13 views

MCQSEXAM

Explanation

urls.py defines URL patterns in Django. It contains a urlpatterns list that maps each URL, via path() or re_path(), to a view.

A project has a root urls.py, and each app usually has its own that is plugged in with include().

Want more practice? Try the full set of Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Django MCQs

Practise all Django MCQs

Similar MCQs