from django.conf.urls import url from django.views.generic.base import RedirectView from . import views app_name = "notes" urlpatterns = [ url( r'(?P\d{4})/(?P\d{2})/(?P[-\w]+).txt$', views.NoteDetailViewTXT.as_view(), name="detail-txt" ), url( r'(?P\d{4})/(?P\d{2})/(?P[-\w]+)$', views.NoteDetailView.as_view(), name="detail" ), url( r'^(?P[0-9]{4})/(?P[0-9]{2})/$', views.NoteMonthArchiveView.as_view(month_format='%m'), name="list_month" ), url( r'(?P\d{4})/$', views.NoteYearArchiveView.as_view(), name="list_year" ), url( r'(?P\d{4})/(?P\d{2})/$', views.date_list, name="notes_by_month" ), url( r'(?P\d{4})/$', views.date_list, name="notes_by_year" ), url( r'(?P\d+)/$', views.NoteList.as_view(), name="list" ), # redirect / to /1/ for live server url( r'', RedirectView.as_view(url="/field-notes/1/", permanent=False), name="live_redirect" ), url( r'^$', views.entry_list, name="notes_archive" ), ]