python - how to get a saved value in redis and use it again (django) -
i'm new redis.
developing django project, wonder how set value in redis in 1 function in views.py
, in function , use again.
can me actual example?
thank much
do want use redis cache backend?it's simple.first install django-redis-cache in settings.py
caches = { 'default': { 'backend': 'redis_cache.rediscache', 'location': 'server:6379', }, } django.core.cache import cache >>> cache.set('my_key', 'hello, world!', 30) >>> cache.get('my_key') 'hello, world!
Comments
Post a Comment