from django.conf.urls import url from django.views.generic.base import RedirectView from . import views app_name = "resume" urlpatterns = [ url( r'pubs/(?P\d+)/$', views.PublisherListView.as_view(), name='list', ), url( r'pubs/(?P[-\w]+)/(?P\d+)/$', views.ByPublisherListView.as_view(), name='list_by_publisher', ), url( r'pubs/(?P[-\w]+)/(?P[-\w]+)$', views.PubItemDetailView.as_view(), name='detail', ), # redirect /slug/ to /slug/1/ for live server url( r'pubs/(?P[-\w]+)/$', RedirectView.as_view(url="/resume/pubs/%(publisher)s/1/", permanent=False), name="live_publisher_redirect" ), url( r'pubs/$', RedirectView.as_view(url="/resume/pubs/1/", permanent=False), name="live_redirect" ), url( r'^(?P[-\w]+)(?:/(?P[-\w]+))$', views.PageView.as_view(), name="pages" ), ]