Content of locmem cache in django?

I tried to use the locmem cache for my web application, but could not find any specific documentation on how I can get the contents of the cache. I want to say that I want to check if my keys in the cache are set correctly. How can I list all the keys in this cache or is it possible?

Get a list of cache keys in Django

This is what I found for memcache but nothing for locmem cache?

PS: I am new to using cache in django, so I can skip a few things. Can anyone refer to good documentation?

+8
python django caching
source share
1 answer

The thing about locmem is that it is actually just local memory. If you look at the code , it is clear that the data is only stored in the level variable of the _caches module in this module. Therefore you can just do

 from django.core.cache.backends import locmem print locmem._caches 
+15
source share

All Articles