django-redis

Python 2.7 and 3.7.2 compatible django-redis serializer

家住魔仙堡 提交于 2020-05-15 08:40:23
问题 I'm trying to write a py2.7 - py3.7 compatible django-redis serializer. I'm using django-redis==4.8.0 with django==1.11.22 and the PickleSerializer . I saw this issue https://github.com/niwinz/django-redis/pull/279 on django-redis and wrote a serializer similar to what's said in the thread. However my object seems a little bit more complex? Not sure. My goal is to have 2 applications running at the same time, one with py2.7 and the other with py3.7. They have to be 100% compatible, and I'm

How to use hset with django-redis-cache?

送分小仙女□ 提交于 2020-03-19 05:32:14
问题 I am new in django/redis and i'm starting to familiarize with heroku redis addon. However, i can only use set and get . When i'm trying to use other methods like hset , i get this error : 'RedisCache' object has no attribute cache.hset('key', 'value') How can i manage this ? 来源: https://stackoverflow.com/questions/48551562/how-to-use-hset-with-django-redis-cache

How to use hset with django-redis-cache?

巧了我就是萌 提交于 2020-03-19 05:30:55
问题 I am new in django/redis and i'm starting to familiarize with heroku redis addon. However, i can only use set and get . When i'm trying to use other methods like hset , i get this error : 'RedisCache' object has no attribute cache.hset('key', 'value') How can i manage this ? 来源: https://stackoverflow.com/questions/48551562/how-to-use-hset-with-django-redis-cache

Removing sessions from Redis (Django)

白昼怎懂夜的黑 提交于 2019-12-05 03:26:02
问题 I'm using Django and Redis as session engine (also Celery, but that is something else). It works perfectly and I can see an improvement in speed. SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db' I have a script that runs every minute to check the active users through some methods and if the user hasn't been active in the latest minute, then the session gets removed. This is done for customer's tracking needs. This script was working perfectly until I switched to Redis as a