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