-urlpatterns = patterns('cover.views',
- url(r'^preview/$', 'preview_from_xml', name='cover_preview'),
- url(r'^preview/(?P<book>[^/]+)/$', 'preview', name='cover_preview'),
- url(r'^preview/(?P<book>[^/]+)/(?P<chunk>[^/]+)/$',
- 'preview', name='cover_preview'),
- url(r'^preview/(?P<book>[^/]+)/(?P<chunk>[^/]+)/(?P<rev>\d+)/$',
- 'preview', name='cover_preview'),
+urlpatterns = [
+ path('preview/', views.preview_from_xml, name='cover_preview'),
+ path('preview/<slug:book>/', views.preview, name='cover_preview'),
+ path('preview/<slug:book>/<slug:chunk>/',
+ views.preview, name='cover_preview'),
+ path('preview/<slug:book>/<slug:chunk>/<int:rev>/',
+ views.preview, name='cover_preview'),