django urlpattern

from django.urls import path
from . import views

urlpatterns = [
    path('home/', views.home, name='home'),
    path('about/', views.about, name='about'),
    path('contact/', views.contact, name='contact'),
]
  1. Import the path function and the views module from the Django urls package.
  2. Define a list named urlpatterns to store the URL patterns for your Django application.
  3. Create a URL pattern for the 'home/' endpoint, linking it to the home function in the views module and assigning the name 'home' to this pattern.
  4. Create a URL pattern for the 'about/' endpoint, linking it to the about function in the views module and assigning the name 'about' to this pattern.
  5. Create a URL pattern for the 'contact/' endpoint, linking it to the contact function in the views module and assigning the name 'contact' to this pattern.