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 redis code to put in CACHES, still even after specifying different redis_url and port, connects to localhost

I want to connect to a different IP url and PORT.

I tried different 'BACKENDS' and CLIENT_CLASS and pools, playing around with different CACHES types. I can connect to my url-port redis using this:

return redis.StrictRedis(host=self.REDIS_URL, port=self.REDIS_PORT, db=0, decode_responses=True, encoding="utf-8")

but not when I want to setup CACHES.

I solved all my redis problems by switching to rabbitmq. I suggest you do the same.

Back to Top