在之前的版本通过django.conf.urls.url函数来实现路径配置:
urlpatterns = [ url(r'^$', views.index), url(r'blog/',views.blog), ]
在2.0版本中,通过django.urls.path函数来配置:
urlpatterns = [ path("^$",views.index), path("blog/",views.blog), path('news/',include('news.urls')), ]
在之前的版本通过django.conf.urls.url函数来实现路径配置:
urlpatterns = [ url(r'^$', views.index), url(r'blog/',views.blog), ]
在2.0版本中,通过django.urls.path函数来配置:
urlpatterns = [ path("^$",views.index), path("blog/",views.blog), path('news/',include('news.urls')), ]