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
Jean Michel Rouly
bookshare
Commits
11abcd45
Commit
11abcd45
authored
Apr 21, 2015
by
Daniel W Bond
Browse files
finnessed, added some cacheing
parent
4a6e3e06
Changes
4
Hide whitespace changes
Inline
Side-by-side
bookshare/core/urls.py
View file @
11abcd45
...
...
@@ -6,7 +6,7 @@ from .views import DetailStudent, StudentRatings
urlpatterns
=
patterns
(
''
,
url
(
r
'^(?P<slug>[\w-]+)/$'
,
DetailStudent
.
as_view
(),
name
=
'profile'
),
cache_page
(
60
*
5
)(
DetailStudent
.
as_view
()
)
,
name
=
'profile'
),
url
(
r
'^(?P<slug>[\w-]+)/ratings/$'
,
cache_page
(
60
*
5
)(
StudentRatings
.
as_view
()),
name
=
'ratings'
),
...
...
bookshare/lookouts/urls.py
View file @
11abcd45
# core django imports
from
django.conf.urls
import
patterns
,
url
from
django.views.decorators.cache
import
cache_page
# imports from your apps
from
.views
import
DetailLookout
,
CreateLookout
,
DeleteLookout
...
...
@@ -9,7 +10,7 @@ urlpatterns = patterns('',
CreateLookout
.
as_view
(),
name
=
'create_lookout'
),
url
(
r
'^(?P<slug>[\w-]+)/$'
,
DetailLookout
.
as_view
(),
name
=
'detail_lookout'
),
cache_page
(
60
*
5
)(
DetailLookout
.
as_view
()
)
,
name
=
'detail_lookout'
),
url
(
r
'^(?P<slug>[\w-]+)/delete/$'
,
DeleteLookout
.
as_view
(),
name
=
'delete_lookout'
),
...
...
bookshare/settings/urls.py
View file @
11abcd45
...
...
@@ -25,8 +25,10 @@ urlpatterns = patterns('',
url
(
r
'^search/'
,
include
(
'haystack.urls'
),
name
=
'search'
),
# site-wide pages
# this page is weird for cacheing... no special url, but different content
# for each user
url
(
r
'^$'
,
HomepageView
.
as_view
(),
name
=
'homepage'
),
url
(
r
'^charts/?$'
,
cache_page
(
60
*
1
5
)(
ChartsView
.
as_view
()),
name
=
'charts'
),
url
(
r
'^charts/?$'
,
cache_page
(
60
*
1
0
)(
ChartsView
.
as_view
()),
name
=
'charts'
),
# static pages
url
(
r
'^about/?$'
,
TemplateView
.
as_view
(
template_name
=
'about.html'
),
...
...
bookshare/trades/urls.py
View file @
11abcd45
...
...
@@ -22,7 +22,7 @@ urlpatterns = patterns('',
EditBid
.
as_view
(),
name
=
'edit_bid'
),
url
(
r
'^listing/(?P<slug>[\w-]+)/flag/$'
,
CreateFlag
.
as_view
(),
name
=
'create_flag'
),
cache_page
(
60
*
5
)(
CreateFlag
.
as_view
()
)
,
name
=
'create_flag'
),
url
(
r
'^listing/(?P<listing_slug>[\w-]+)/flag/(?P<slug>[\w-]+)/remove/$'
,
DeleteFlag
.
as_view
(),
name
=
'delete_flag'
),
...
...
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