开发者

How to cache a view in urls.py when it is direct to template

I would like to cache a template and I know that it possible to do this in the url. However, the specific template I would like to cache is also delviered with a direct to template:

(r'^menu/$', direct_to_template, { 'template': 'corp_menu.html' }),

Does anyone know how to convert my url to cache this using the dja开发者_C百科ngo documentation:

The django documentation shows

urlpatterns = ('',
(r'^foo/(\d{1,2})/$', cache_page(60 * 15)(my_view)),
)

Thanks for any help


(r'^menu/$', cache_page(60 * 15)(direct_to_template), { 'template': 'corp_menu.html' }),

should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜