code: def get_view(cls, method_name):
          
          method = getattr(cls, method_name)
  
          @wraps(method)
          def view(request, **kwargs):
              handler = cls(request, kwargs)
              handler.call_processors('view')
              response = None
              try:
                  response = method(handler)
                  return response
              finally:
                  handler.call_processors('post_view', response=response)
  
          return view
docs: Get a Django function view calling the given method (and pre/post-processors)
  
          :param method_name: The method on the class
          :return: View function