diff --git a/project/redirectors.py b/project/redirectors.py index cc9fda5..a8afbe4 100644 --- a/project/redirectors.py +++ b/project/redirectors.py @@ -1,7 +1,9 @@ -from django.http import HttpResponse, HttpResponseRedirect +from django.http import HttpResponseRedirect + def tv_channel_schedule(request, key): return HttpResponseRedirect("http://tv.azpm.org/schedules/%s/" % key) - + + def tv_episode_detail(request, id): - return HttpResponseRedirect("http://tv.azpm.org/schedules/episode/%d/" % int(id)) \ No newline at end of file + return HttpResponseRedirect("http://tv.azpm.org/schedules/episode/%d/" % int(id)) diff --git a/project/urls.py b/project/urls.py index 83e8afb..95eb6e3 100755 --- a/project/urls.py +++ b/project/urls.py @@ -1,14 +1,14 @@ -from django.conf.urls import * +from django.conf.urls import url, include from django.contrib import admin -from libscampi.contrib import cms +from libscampi.contrib.cms.sites import site +from project import redirectors admin.autodiscover() -urlpatterns = patterns('', - (r'^comments/', include('django.contrib.comments.urls')), - (r'^admin/doc/', include('django.contrib.admindocs.urls')), - (r'^admin/', include(admin.site.urls)), - url(r'^tv-schedule-forward/(?P\w+)/$', 'project.redirectors.tv_channel_schedule', name="channel-today"), - url(r'^tv-episode-forward/(?P\w+)/$', 'project.redirectors.tv_episode_detail', name="episode-detail"), - (r'', include(cms.site.urls)) -) +urlpatterns = [ + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/', include(admin.site.urls)), + url(r'^tv-schedule-forward/(?P\w+)/$', redirectors.tv_channel_schedule, name="channel-today"), + url(r'^tv-episode-forward/(?P\w+)/$', redirectors.tv_episode_detail, name="episode-detail"), + url(r'', include(site.urls)) +]