Home›Learn›Django›URLs and Routing
Django Master CourseBeginner Friendly

URLs and Routing

Learn how Django maps URLs to views.

📘 Chapter 6 / 34⏱️ 8–10 Min Read🎯 Beginner Friendly
Course Progress18%

Course Progress

18%

6 / 34 chapters

📖

Theory

Understand the concept step by step

Django uses URL patterns to connect incoming browser requests with Python views. URL patterns are commonly defined inside urls.py. The path() function is used to define URL routes.
💻

Example

See how the concept works in Django

Django / Python
from django.urls import path
from . import views

urlpatterns = [
    path("", views.home, name="home"),
]
📤

Output

Understand what the code produces

Visiting the configured URL calls the corresponding view.

📝

Practice

Test your understanding

Create a URL route that connects /home/ to a home view.

❓

MCQs

Check your knowledge

What is the main topic covered in URLs and Routing?

A.urls.py
B.models.py
C.admin.py
D.forms.py
💼

Interview Questions

Prepare for Django interviews

1

Interview Question

What is URL routing in Django?

2

Interview Question

What is urlpatterns?

3

Interview Question

What does the path() function do?