4👍
✅
Django introduced the Redis backend in version 4.0.
https://docs.djangoproject.com/en/4.1/topics/cache/#redis
Make sure the the Django version in the docker container is at least 4.0.
Or if you don’t want to upgrade Django, you can use packages such as django-redis
.
1👍
I think the issue comes from the line 'LOCATION': 'redis://127.0.0.1:6379'
which do not match the name you’ve given to the redis
container in your docker network.
Indeed, the command docker run --name some-redis -d redis
assigns some-redis
to the container name, so yo have to refer to your Redis instance with this name in your Python code.
In a nutshell, you have to replace 'LOCATION': 'redis://127.0.0.1:6379'
by 'LOCATION': 'redis://some-redis:6379'
in the above code.
- [Django]-Python telegram bot: Access to contact information
- [Django]-Import Error: no module named transaction
- [Django]-Why is my JSON from Django being cut-off at about 2.1MB?
- [Django]-User permissions for Django module
- [Django]-File transfer between app and media server
Source:stackexchange.com