On Sat, Apr 7, 2012 at 3:53 PM, Phang Mulianto <braveh...@gmail.com> wrote:
> Hi,
>
> i have my apps and try to use cache decorator in url.py but got error.
>
> Here are the urls.py
>
> from django.views.decorators.cache import cache_page
>
> urlpatterns = patterns('article.views',
>     #(r'^$','index', { 'template_name': 'blog/public_list.html'}, 'index'),
>     (r'^$',cache_page('index'), { 'template_name': 'blog/public_list.html'},
> 'index'),
> )
>
> the error is :
>
> cache_page must be passed a view function if called with two arguments
>
> what is wrong in the url.. note i also use the DDT (django debug toolbar) .
>
> THanks for pointing me out..

https://docs.djangoproject.com/en/1.3/topics/cache/#specifying-per-view-cache-in-the-urlconf

cache_page wraps a function, not a string.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to