[Answered ]-How can I access the rest of the lower name spaces with django-redis?

2👍

You can do the following to get access to the redis client directly to access those values:

from django.core.cache import caches

default_cache = caches['default']
redis = default_cache.get_master_client()
# now you can use any of the redis client operations on redis
redis.hgetall('BATCH-RP-FAIL')
# or redis.smembers, etc.

n.b., the redis client is much more finicky about what type a particular key is. So you have to make sure that you are using the s operations for redis sets, h operations for redis hashes, etc. In other words, you will have to know the type of the object you are accessing with the redis client whereas the django cache client only requires you to use set and get and converts types using serialization.

👤2ps

Leave a comment