title: using @cache_response() decorator from drf extensions while using @api_view function view
body: <p>I want to cache my API responses. I am using <code>Django Rest Framework</code> and want use for this purpose <code>@cache_response()</code> decorator from <code>drf extensions</code>.</p>
  
  <p>I am following examples from: <a href="http://chibisov.github.io/drf-extensions/docs/#cache-response" rel="nofollow">http://chibisov.github.io/drf-extensions/docs/#cache-response</a> There are only examples of class based views.</p>
  
  <p>When I apply it like this:</p>
  
  <pre><code>@api_view(http_method_names=['GET'])
  @cache_response()
  def my_view(request, some_arg):
      (...)
  </code></pre>
  
  <p>I end up with error: </p>
  
  <pre><code>inner() takes at least 2 arguments (1 given)
  </code></pre>
  
  <p>Full traceback:</p>
  
  <pre><code>Traceback:
  
      File "/Users/andi/.virtualenvs/adfoo/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
        112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
      File "/Users/andi/.virtualenvs/adfoo/lib/python2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view
        57.         return view_func(*args, **kwargs)
      File "/Users/andi/.virtualenvs/adfoo/lib/python2.7/site-packages/django/views/generic/base.py" in view
        69.             return self.dispatch(request, *args, **kwargs)
      File "/Users/andi/.virtualenvs/adfoo/lib/python2.7/site-packages/rest_framework/views.py" in dispatch
        407.             response = self.handle_exception(exc)
      File "/Users/andi/.virtualenvs/adfoo/lib/python2.7/site-packages/rest_framework/views.py" in dispatch
        404.             response = handler(request, *args, **kwargs)
      File "/Users/andi/.virtualenvs/adfoo/lib/python2.7/site-packages/rest_framework/decorators.py" in handler
        51.             return func(*args, **kwargs)
  
      Exception Type: TypeError at /api/foo/1/exhibitors/
      Exception Value: inner() takes at least 2 arguments (1 given)
  </code></pre>
  
  <p>How should I apply it correctly?</p>
  
  <p>DRF extensions specifies for the decorator following requirenets for decorated method:</p>
  
  <p>1) It should be method of class which is inherited from rest_framework.views.APIView</p>
  
  <p>2) It should return rest_framework.response.Response instance.</p>
  
  <p>taking into account point 1) I am not sure if its at all possible..</p>
  
  <p>here is the source of drf <code>@api_view</code> decorator <a href="https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/decorators.py" rel="nofollow">https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/decorators.py</a></p>
  
  <p>and here is the source of drf extension <code>@cache_response</code> decorator <a href="https://github.com/chibisov/drf-extensions/blob/master/rest_framework_extensions/cache/decorators.py" rel="nofollow">https://github.com/chibisov/drf-extensions/blob/master/rest_framework_extensions/cache/decorators.py</a></p>