0
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 127.0.0.1:6379

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 am connected now Localy, but when I run python manage.py index, still runing in same error where django tryes to index in localhost – Florent Hoti Jan 29 '23 at 20:39

1 Answers1

-1

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

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 28 '23 at 10:04