mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Deprecated legacy ways of calling cache_page
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b67ff14208
commit
bb12a02bd8
5 changed files with 44 additions and 4 deletions
|
@ -494,7 +494,7 @@ __ `Controlling cache: Using other headers`_
|
|||
The per-view cache
|
||||
==================
|
||||
|
||||
.. function ``django.views.decorators.cache.cache_page``
|
||||
.. function:: django.views.decorators.cache.cache_page
|
||||
|
||||
A more granular way to use the caching framework is by caching the output of
|
||||
individual views. ``django.views.decorators.cache`` defines a ``cache_page``
|
||||
|
@ -571,7 +571,7 @@ Here's the same thing, with ``my_view`` wrapped in ``cache_page``::
|
|||
from django.views.decorators.cache import cache_page
|
||||
|
||||
urlpatterns = ('',
|
||||
(r'^foo/(\d{1,2})/$', cache_page(my_view, 60 * 15)),
|
||||
(r'^foo/(\d{1,2})/$', cache_page(60 * 15)(my_view)),
|
||||
)
|
||||
|
||||
If you take this approach, don't forget to import ``cache_page`` within your
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue