from django.conf.urls import url from django.views.generic.base import RedirectView from . import views app_name = "links" urlpatterns = [ url( r'tag/(?P[-\w]+)/(?P\d+)/$', views.LinkTagListView.as_view(), name='list-tag' ), url( r'(?P[-\d]+).txt$', views.LinkDetailViewTXT.as_view(), name="detail-txt" ), url( r'(?P[-\d]+)$', views.LinkDetailView.as_view(), name='detail' ), url( r'(?P\d+)/$', views.LinkListView.as_view(), name='list' ), url( r'^tag/(?P[-\w]+)/$', RedirectView.as_view(url="/links/tag/%(slug)s/1/", permanent=False), name="live-redirect-tag" ), url( r'^$', RedirectView.as_view(url="/links/1/", permanent=False), name="live-redirect" ), ]