title: cache_page with Class Based Views
body: <p>I'm trying to do cache_page with class based views (TemplateView) and i'm not able to. I followed instructions here:</p>
  
  <p><a href="https://stackoverflow.com/questions/7841772/django-url-caching-failing-for-class-based-views">Django--URL Caching Failing for Class Based Views</a></p>
  
  <p>as well as here:</p>
  
  <p><a href="https://github.com/msgre/hazard/blob/master/hazard/urls.py" rel="noreferrer">https://github.com/msgre/hazard/blob/master/hazard/urls.py</a></p>
  
  <p>But I get this error:</p>
  
  <pre><code>cache_page has a single mandatory positional argument: timeout
  </code></pre>
  
  <p>I read the code for cache_page and it has the following:</p>
  
  <pre><code>if len(args) != 1 or callable(args[0]):
      raise TypeError("cache_page has a single mandatory positional argument: timeout")
  cache_timeout = args[0]
  </code></pre>
  
  <p>which means it wont allow more than 1 argument. Is there any other way to get cache_page to work?? I have been digging into this for sometime...</p>
  
  <p>It seems like the previous solutions wont work any longer</p>