url部分: url(r'^book/$',views.book.as_view()),url(r'^books/(\d+)/$', views.bookdetail.as_view(),name='book_detail'), #url(r'^books/(?P<pk>\d+)/$', views.bookdetail.as_view(), name='book_detail'),##有名分组,当设置了HyperlinkedIdentityField的时候 ''' 讲解:当下面的url被访问…