Here is the method to directly view the contents of Django Redis from the Django shell.
./manage.py shell
from django_redis import get_redis_connection
# Create a Redis connection
r = get_redis_connection('default')
# Get a list of keys with a limit
r.scan(count=1000)
# Get a list of keys with a pattern
r.keys('ranking_cache_*')
# The contents are pickled, so they cannot be read as is
r.get('my_cache_key')
# Unpickle to read the contents
import pickle
pickle.loads(r.get('my_cache_key'))
Comments