Commit d44076dd authored by Daniel W Bond's avatar Daniel W Bond
Browse files

cache added on pages, but at only six seconds

parent 54269475
# core django imports # core django imports
from django.conf.urls import patterns, url from django.conf.urls import patterns, url
from django.views.decorators.cache import cache_page
# imports from your apps # imports from your apps
from .views import DetailStudent, StudentRatings, UpdateStudent from .views import DetailStudent, StudentRatings, UpdateStudent
...@@ -8,8 +9,8 @@ urlpatterns = patterns('', ...@@ -8,8 +9,8 @@ urlpatterns = patterns('',
UpdateStudent.as_view(), name='name_change'), UpdateStudent.as_view(), name='name_change'),
url(r'^(?P<slug>[\w-]+)/$', url(r'^(?P<slug>[\w-]+)/$',
DetailStudent.as_view(), name='profile'), cache_page(6)(DetailStudent.as_view()), name='profile'),
url(r'^(?P<slug>[\w-]+)/ratings/$', url(r'^(?P<slug>[\w-]+)/ratings/$',
StudentRatings.as_view(), name='ratings'), cache_page(6)(StudentRatings.as_view()), name='ratings'),
) )
...@@ -16,7 +16,7 @@ urlpatterns = patterns('', ...@@ -16,7 +16,7 @@ urlpatterns = patterns('',
CreateListing.as_view(), name='create_listing'), CreateListing.as_view(), name='create_listing'),
url(r'^listing/(?P<slug>[\w-]+)/$', url(r'^listing/(?P<slug>[\w-]+)/$',
ListingPage.as_view(), name='detail_listing'), cache_page(6)(ListingPage.as_view()), name='detail_listing'),
url(r'^listing/(?P<slug>[\w-]+)/delete/$', url(r'^listing/(?P<slug>[\w-]+)/delete/$',
DeleteListing.as_view(), name='delete_listing'), DeleteListing.as_view(), name='delete_listing'),
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