Commit 886a07d1 authored by David Haynes's avatar David Haynes 🙆

Add cache support to accounts app urls.py

parent f15c20d6
# core django imports
from django.conf.urls import patterns, include, url
from django.views.decorators.cache import cache_page
# imports from your apps
from .views import DetailStudent, UpdateStudent, DetailStudentSettings,\
DetailCurrentStudent, DetailCurrentStudentSettings, UpdateStudentMajor,\
......@@ -10,24 +11,32 @@ urlpatterns = patterns('',
url(r'', include('allauth.urls')),
url(r'^majors/$', ListMajors.as_view(), name='list_majors'),
url(r'^majors/$',
cache_page(60 * 15)(ListMajors.as_view()),
name='list_majors'),
url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$', DetailMajor.as_view(),
url(r'^majors/(?P<slug>[\w-]+)/(?P<major>[\w-]+)/$',
cache_page(60 * 2)(DetailMajor.as_view()),
name='detail_major'),
url(r'^student/(?P<slug>[\w-]+)/$',
DetailStudent.as_view(), name='detail_student'),
url(r'^student/$',
DetailCurrentStudent.as_view(), name='detailCurrentStudent'),
cache_page(60 * 2)(DetailCurrentStudent.as_view()),
name='detailCurrentStudent'),
url(r'^student/(?P<slug>[\w-]+)/$',
cache_page(60 * 2)(DetailStudent.as_view()),
name='detail_student'),
url(r'^student/(?P<slug>[\w-]+)/welcome/$',
UpdateStudent.as_view(), name='updateStudent'),
cache_page(60 * 15)(UpdateStudent.as_view()),
name='updateStudent'),
url(r'^(?P<slug>[\w-]+)/major/$',
UpdateStudentMajor.as_view(), name='updateStudentMajor'),
cache_page(4)(UpdateStudentMajor.as_view()),
name='updateStudentMajor'),
url(r'^settings/$',
DetailCurrentStudentSettings.as_view(), name='currentStudentSettings'),
cache_page(4)(DetailCurrentStudentSettings.as_view()),
name='currentStudentSettings'),
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment