Get list of Cache Keys in Django

前端 未结 8 2041
暗喜
暗喜 2020-12-15 17:28

I\'m trying to understand how Django is setting keys for my views. I\'m wondering if there\'s a way to just get all the saved keys from Memcached. something like a cac

8条回答
  •  [愿得一人]
    2020-12-15 17:58

    For RedisCache you can get all available keys with.

    from django.core.cache import cache
    
    cache.keys('*')
    

提交回复
热议问题