我正在try 使用基于类的视图(TemplateView)来缓存页面,但我无法.我按照这里的指示:
Django--URL Caching Failing for Class Based Views个
就像这里一样:
https://github.com/msgre/hazard/blob/master/hazard/urls.py个
但是我得到了这个错误:
cache_page has a single mandatory positional argument: timeout
我读取了CACHE_PAGE的代码,它具有以下内容:
if len(args) != 1 or callable(args[0]):
raise TypeError("cache_page has a single mandatory positional argument: timeout")
cache_timeout = args[0]
这意味着它不允许超过1个参数.有没有其他方法可以让cache_page正常工作??我调查这件事已经有一段时间了.
以前的解决方案似乎不再管用了