I would like to know if there is a way to inspect the content stored in the local memory cache from Django shell.
I found this answer: Contents of locmem cache in django?
But it did not work. This is what I have tried so far:
python manage.py shell
>>> from django.core.cache import caches
>>> caches.all()
[]
I found the wonderful plugin: Django debug toolbar. I can verify from the debug panel that the cache I created did exist and it has content in it.
I just want to know how to look at the cached content from Django shell.
Thanks!
Here is how I defined my local memory cache:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'question_cache',
'TIMEOUT': 60 * 60, # 60 secs * 60 mins
'OPTIONS': {
'MAX_ENTRIES': 100
},
}
}