from django.urls import path, re_path from django.views.generic.base import RedirectView from . import views app_name = "links" urlpatterns = [ re_path( r'^tag/(?P[-\w]+)/$', views.LinkTagListView.as_view(), {'page':1}, name='list-tag' ), re_path( r'tag/(?P[-\w]+)/(?P\d+)/$', views.LinkTagListView.as_view(), name='list-tag' ), re_path( r'(?P[-\d]+).txt$', views.LinkDetailViewTXT.as_view(), name="detail-txt" ), path( r'', views.LinkDetailView.as_view(), name='detail' ), re_path( r'(?P\d+)/$', views.LinkListView.as_view(), name='list' ), path( r'', views.LinkListView.as_view(), {'page':1}, name='list' ), ]