@lru_cache(maxsize=None)
def cache_installed():
 has_key = bool(getattr(settings, u'NEVERCACHE_KEY', u''))
 def flatten(seqs):
  return (item for seq in seqs for item in seq)
 middleware_classes = map(import_string, get_middleware_setting())
 middleware_ancestors = set(flatten(map(getmro, middleware_classes)))
 mezzanine_cache_middleware_classes = {import_string(u'mezzanine.core.middleware.UpdateCacheMiddleware'), import_string(u'mezzanine.core.middleware.FetchFromCacheMiddleware')}
 return (has_key and settings.CACHES and (not settings.TESTING) and mezzanine_cache_middleware_classes.issubset(middleware_ancestors))

@ lru_cache ( maxsize = None ) def cache_installed ( ) : has_key = bool ( getattr ( settings , u'NEVERCACHE_KEY' , u'' ) ) def flatten ( seqs ) : return ( item for seq in seqs for item in seq ) middleware_classes = map ( import_string , get_middleware_setting ( ) ) middleware_ancestors = set ( flatten ( map ( getmro , middleware_classes ) ) ) mezzanine_cache_middleware_classes = { import_string ( u'mezzanine.core.middleware.UpdateCacheMiddleware' ) , import_string ( u'mezzanine.core.middleware.FetchFromCacheMiddleware' ) } return ( has_key and settings . CACHES and ( not settings . TESTING ) and mezzanine_cache_middleware_classes . issubset ( middleware_ancestors ) )
returns true if a cache backend is configured .