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

Popular posts from this blog

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -