URL配置(URLconf)就像Django所支撑网站的目录。它的本指是URL与要为该URL调用的视图函数之间的映射表,你就是以这种方式告诉Django,对于客户端发来的某个URL调用哪一段逻辑代码对应执行。 一、简单的路由配置 from django.urls import path,re_path from app01 import views urlpatterns = [ re_path(r'^articles/2003/$', views.special_case_2003), re_path(r'^articles/([0-9]{4})/$', views.year_archi