Questions tagged [django-redis]
105 questions
0
votes
1 answer
django-redis and redis returning different results
I am using django-redis in my server to make less queries to the db. I recently setup a lambda where I needed to access the same data from the redis cache. But it seems that I am served different data if I connect to the redis cache using…

Asfandyar Abbasi
- 53
- 2
- 7
0
votes
0 answers
Django Websocket is not sending instant within group
I have a websocket that should send messages very x seconds. I am connecting to the socket from two clients. THe socket should send the message to both when one of them sends a start message but only the one which doesnt started is getting the…

Niklas
- 119
- 5
0
votes
1 answer
Redis django connects to localhost redis, even when I change URL and PORT
return {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': f'redis://{self.REDIS_URL}:{self.REDIS_PORT}',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
}
this is my…

Florent Hoti
- 1
- 1
0
votes
0 answers
SessionId inside the cookie header slows down response (Django)
I'm learning how to use django sessions and caching.
I noticed that once I login, a sessionId is included in the cookie header. I'm using the "@authentication_classes" and "@permission_classes" decorators to validate the session.
I'm also using…

Marchesi Gabriele
- 11
- 2
0
votes
0 answers
Can I use only one redis connection for my django app?
Introduction:
django 3.2.16
django-redis 4.12.1
Problem: I use redis as a cache storage. I put the data to redis manually using the next code:
from django_redis import get_redis_connection
def redis_handler() -> None:
redis =…

Vadim Beglov
- 343
- 1
- 4
- 15
0
votes
1 answer
Cannot connect to redis while using Sentinels in django-redis
Currently I am trying to integrate redis into my django project which is docker based. I was able to integrate redis using the DefaultClient but it doesn't work for SentinelClient
My settings.py looks like this:
DJANGO_REDIS_CONNECTION_FACTORY =…

Ahsan
- 31
- 1
- 6
0
votes
0 answers
django @cache_page decorator not setting a cache
Here's my cache setting:
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379',
'OPTIONS': {
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
}
…

Azima
- 3,835
- 15
- 49
- 95
0
votes
0 answers
Error 111 connecting to 127.0.0.1:6379. Connection refused. cPanel (Django)
I'm using django-redis for caching. Everything works fine on local, but I got an error on production development (using cPanel).
Does anyone know how to use django-redis on the production server?

penk
- 197
- 1
- 3
- 14
0
votes
1 answer
Can django-redis use dbsize?
django-redis source: https://github.com/jazzband/django-redis/tree/master/django_redis
my problem is I can not find method to get number of keys in Redis database, it call dbsize. Methods that available such as set, get, add, delete, delete_pattern,…

Bhornumnard Wanasrisun
- 61
- 1
- 5
0
votes
1 answer
django-redis persisting json data
I have a small django site which controls an anstronomy dome and house automation. On start up the project loads 3 json files: relays, conditions and homeautomation. To avoid constant reading and writing to the Pi4's ssd I load the json files into…

SgtBilko
- 55
- 2
- 9
0
votes
0 answers
Django Redis Caching how can i set cache timeout to none (never expiring cache) in class base view
I'm using redis server for caching. Using django-redis package.
Below is my setting file :
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/1',
'OPTIONS': {
…

Ganesh sali
- 116
- 1
- 5
0
votes
1 answer
redis in django requirements
hello friends i work in Django project and use Redis for its chache.i run Redis in my local and i use docker for run Redis to (both Redis in local and Docker Rdis are ok and work for me for have redis server up) and i add django-redis by install it…

fahime
- 5
- 4
0
votes
0 answers
RedisCache' object has no attribute 'ttl'
hello friends in new project i use Django4 and i set the "django.core.cache.backends.redis.RedisCache" for the cache but i have the error it say
"AttributeError: 'RedisCache' object has no attribute 'ttl'" .it refer to the line of my code that i add…

fahime
- 5
- 4
0
votes
1 answer
How to notify users of new blog post via django?
I am building a mobile app using Django Rest Framework, Flutter, and MongoDB. In that app users can view posts posted by other users.
In my Django app, I don't have any notification model (and honestly don't really know how to use that either!).
In…

Farrukh Nadeem
- 19
- 5
0
votes
1 answer
OperationalError, Error 111 connecting to 127.0.0.1:6379. Connection refused. After deploying in heroku
I am getting the below error after I deployed my website on heroku.
Error 111 connecting to 127.0.0.1:6379. Connection refused.
Request Method: POST
Request URL: https://website.herokuapp.com/account/register
Django Version: 3.2.8
Exception Type:…

Ritankar Bhattacharjee
- 639
- 1
- 6
- 25