From 3838b4d64823868755d4a08a574b94f39fd06fb4 Mon Sep 17 00:00:00 2001 From: nnrcschmdt Date: Mon, 12 Jun 2017 20:32:21 -0400 Subject: removed django.conf.urls.patterns diff --git a/nop/urls.py b/nop/urls.py index 392d633..936af7a 100644 --- a/nop/urls.py +++ b/nop/urls.py @@ -1,13 +1,15 @@ -from django.conf.urls import patterns, url +from django.conf.urls import url +from django.views.static import serve + from views import get, get_current, nop_form import os NOP_SITE_MEDIA = os.path.join(os.path.dirname(__file__), 'site_media') -urlpatterns = patterns('', - url(r'^/get_current/?$', get_current), - url(r'^/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\d{1,2})/(?P\d{1,2})/?$', get), - url(r'^/?$', nop_form), - url(r'^/static/(?P.*)$', 'django.views.static.serve', {'document_root': NOP_SITE_MEDIA}), - ) +urlpatterns = [ + url(r'^get_current/?$', get_current), + url(r'^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\d{1,2})/(?P\d{1,2})/?$', get), + url(r'^$', nop_form), + url(r'^static/(?P.*)$', serve, {'document_root': NOP_SITE_MEDIA}), +] diff --git a/program/urls.py b/program/urls.py index a3badf3..abd6543 100644 --- a/program/urls.py +++ b/program/urls.py @@ -1,29 +1,28 @@ from django.conf import settings -from django.conf.urls import patterns, url +from django.conf.urls import url from django.views.decorators.cache import cache_page - +from django.views.static import serve import views import os PROGRAM_SITE_MEDIA = os.path.join(os.path.dirname(__file__), '../site_media') -urlpatterns = patterns('', - url(r'^today/?$', views.DayScheduleView.as_view()), - url(r'^week/?$', views.WeekScheduleView.as_view()), - url(r'^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/?$', views.DayScheduleView.as_view()), - url(r'^(?P\d{4})/(?P\d{1,2})/?$', views.WeekScheduleView.as_view()), - url(r'^current_box/?$', cache_page(60)(views.CurrentShowBoxView.as_view())), - url(r'^hosts/?$', views.HostListView.as_view()), - url(r'^hosts/(?P\d+)/?$', views.HostDetailView.as_view(), name='host-detail'), - url(r'^tips/?$', views.RecommendationsListView.as_view()), - url(r'^tips_box/?$', views.RecommendationsBoxView.as_view()), - url(r'^shows/?$', views.ShowListView.as_view()), - url(r'^shows/(?P[\w-]+)/?$', views.ShowDetailView.as_view(), name='show-detail'), - url(r'^(?P\d+)/?$', views.TimeSlotDetailView.as_view(), name='timeslot-detail'), - url(r'^styles.css$', views.StylesView.as_view()) - ) +urlpatterns = [ + url(r'^today/?$', views.DayScheduleView.as_view()), + url(r'^week/?$', views.WeekScheduleView.as_view()), + url(r'^(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/?$', views.DayScheduleView.as_view()), + url(r'^(?P\d{4})/(?P\d{1,2})/?$', views.WeekScheduleView.as_view()), + url(r'^current_box/?$', cache_page(60)(views.CurrentShowBoxView.as_view())), + url(r'^hosts/?$', views.HostListView.as_view()), + url(r'^hosts/(?P\d+)/?$', views.HostDetailView.as_view(), name='host-detail'), + url(r'^tips/?$', views.RecommendationsListView.as_view()), + url(r'^tips_box/?$', views.RecommendationsBoxView.as_view()), + url(r'^shows/?$', views.ShowListView.as_view()), + url(r'^shows/(?P[\w-]+)/?$', views.ShowDetailView.as_view(), name='show-detail'), + url(r'^(?P\d+)/?$', views.TimeSlotDetailView.as_view(), name='timeslot-detail'), + url(r'^styles.css$', views.StylesView.as_view()) +] + if settings.DEBUG: - urlpatterns += \ - patterns('', - url(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': PROGRAM_SITE_MEDIA})) + urlpatterns.append(url(r'^static/(?P.*)$', serve, {'document_root': PROGRAM_SITE_MEDIA})) diff --git a/pv/urls.py b/pv/urls.py index 9617f8e..f98373f 100644 --- a/pv/urls.py +++ b/pv/urls.py @@ -1,22 +1,20 @@ from django.conf import settings -from django.conf.urls import patterns, url, include +from django.conf.urls import url, include from django.contrib import admin +from django.views.static import serve from program.views import json_day_schedule, json_timeslots_specials admin.autodiscover() -urlpatterns = patterns('', - url(r'^admin/', include(admin.site.urls)), - url(r'^program/', include('program.urls')), - url(r'^nop', include('nop.urls')), - url(r'^tinymce/', include('tinymce.urls')), - url(r'^export/day_schedule/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/$', json_day_schedule), - url(r'^export/timeslots_specials.json$', json_timeslots_specials) - ) +urlpatterns = [ + url(r'^admin/', include(admin.site.urls)), + url(r'^program/', include('program.urls')), + url(r'^nop', include('nop.urls')), + url(r'^tinymce/', include('tinymce.urls')), + url(r'^export/day_schedule/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/$', json_day_schedule), + url(r'^export/timeslots_specials.json$', json_timeslots_specials) +] if settings.DEBUG: - urlpatterns += patterns('', - (r'^site_media/(?P.*)$', 'django.views.static.serve', - {'document_root': settings.MEDIA_ROOT}) - ) + urlpatterns.append(url(r'^site_media/(?P.*)$', serve, {'document_root': settings.MEDIA_ROOT})) -- cgit v0.10.2