from django.contrib import admin
from django.urls import path, include
from django.urls import re_path
from lesson_two import views
urlpatterns = [
path('', views.home),
path('admin/', admin.site.urls),
path('', include('lesson_one.urls')),
path('', include('lesson_two.urls')),
]
from django.urls import path, re_path
from . import views
urlpatterns = [
path('' , views.home),
path('items/', views.items, name = 'items'),
path('items/2003/', views.special_case_2003, name = 'special_case_2003'),
path('items/<int>', views.year_archive, name = 'year_archive'),
]
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return HttpResponse('Home Page!')
def items(request):
return HttpResponse('Welcome to localhost/items ')
def special_case_2003(request):
return HttpResponse('Welcome to localhost/items/2003 ')
def year_archive(request):
return HttpResponse('Welcome to localhost/items/([0-9]{4})/ ')