1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
from django.urls import path, re_path from . import views app_name = "books" urlpatterns = [ re_path( r'^(?P<page>\d+)/$', views.BookListView.as_view(), name="list" ), path( r'', views.BookListView.as_view(), {'page': 1}, name="list" ), path( r'<str:slug>/', views.BookDetailView.as_view(), name='detail', ), ]