Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
bookshare
Commits
956cd3c5
Commit
956cd3c5
authored
Apr 21, 2015
by
Daniel W Bond
Browse files
added cacheing to three page
parent
bdc79ff1
Changes
3
Hide whitespace changes
Inline
Side-by-side
bookshare/core/urls.py
View file @
956cd3c5
# 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'
),
)
)
bookshare/settings/urls.py
View file @
956cd3c5
...
@@ -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'
),
...
...
bookshare/trades/urls.py
View file @
956cd3c5
# 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'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment