最新版Django用视图使用问题

  旧版本:

  

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^', include('booktest.urls')),
]

新版本:

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls),
path('', include('booktest.urls')),
]

 

 
posted @ 2020-02-01 20:37  殇之弑梦  阅读(100)  评论(0编辑  收藏  举报