我试图做cache_page与基于类的视图(TemplateView),我不能够。我也跟着指示进行:cache_page与基于类的视图
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工作?我一直在挖掘到这了一段时间...
好像以前的解决方案不会再工作下去
文档如果不追加你的urls.py我们将无法帮助...... – petkostas