django3.0路由学习
一、路径的匹配 from django.contrib import admin from django.urls import path from index import views urlpatterns = [ path('articles/2003/', views.special_case_2003), path('articles/<int:year>/', views.year_archive), path('articles/<int:year>/<int:month>/', views.month_archive), path('articles/<int:year>/<int:month>/<slug:slug>/', views.article_detail), ] url.py from django.http import HttpResponse def special_case_2003(request): return HttpResponse("This is the special 2003") def year_archive(request,year): return HttpResponse("This is year archive,Year number is %d" % year) def month_archive(request