def is_api_view(callback):
 cls = getattr(callback, 'cls', None)
 return ((cls is not None) and issubclass(cls, APIView))

def is_api_view ( callback ) : cls = getattr ( callback , 'cls' , None ) return ( ( cls is not None ) and issubclass ( cls , APIView ) )
return true if the given view callback is a rest framework view/viewset .