Commit 956cd3c5 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

added cacheing to three page

parent bdc79ff1
# 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 from .views import DetailStudent, StudentRatings
...@@ -8,5 +9,5 @@ urlpatterns = patterns('', ...@@ -8,5 +9,5 @@ urlpatterns = patterns('',
DetailStudent.as_view(), name='profile'), DetailStudent.as_view(), name='profile'),
url(r'^(?P<slug>[\w-]+)/ratings/$', url(r'^(?P<slug>[\w-]+)/ratings/$',
StudentRatings.as_view(), name='ratings'), cache_page(60 * 5)(StudentRatings.as_view()), name='ratings'),
) )
...@@ -4,6 +4,7 @@ from django.views.generic import TemplateView ...@@ -4,6 +4,7 @@ from django.views.generic import TemplateView
from django.conf.urls.static import static from django.conf.urls.static import static
from django.conf import settings from django.conf import settings
from django.contrib import admin from django.contrib import admin
from django.views.decorators.cache import cache_page
# imports from your apps # imports from your apps
from .views import HomepageView, ChartsView from .views import HomepageView, ChartsView
...@@ -25,7 +26,7 @@ urlpatterns = patterns('', ...@@ -25,7 +26,7 @@ urlpatterns = patterns('',
# site-wide pages # site-wide pages
url(r'^$', HomepageView.as_view(), name='homepage'), url(r'^$', HomepageView.as_view(), name='homepage'),
url(r'^charts/?$', ChartsView.as_view(), name='charts'), url(r'^charts/?$', cache_page(60 * 15)(ChartsView.as_view()), name='charts'),
# static pages # static pages
url(r'^about/?$', TemplateView.as_view(template_name='about.html'), url(r'^about/?$', TemplateView.as_view(template_name='about.html'),
......
# 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 ListListings, CreateListing, ListingPage,\ from .views import ListListings, CreateListing, ListingPage,\
CreateFlag, DeleteFlag, EditListing, SellListing,\ CreateFlag, DeleteFlag, EditListing, SellListing,\
...@@ -9,7 +10,7 @@ from .views import ListListings, CreateListing, ListingPage,\ ...@@ -9,7 +10,7 @@ from .views import ListListings, CreateListing, ListingPage,\
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^all/$', url(r'^all/$',
ListListings.as_view(), name='list_listings'), cache_page(60 * 5)(ListListings.as_view()), name='list_listings'),
url(r'^new/$', url(r'^new/$',
CreateListing.as_view(), name='create_listing'), CreateListing.as_view(), name='create_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