How can I configure Django to search for the Redis backend on the server instead of localhost?
I am working on updating an old Django 2.2 app, and am running into an issue with the connections between Celery, Django, Docker, and Redis. I am using Docker Compose to build the app, and using Celery to schedule tasks with Redis as a backend. Celery schedules emails to be sent and I am able to receive those emails, so I am pretty sure that Celery is properly connected to Redis. When running django.contrib.auth.login(), I run into an error TypeError: Cannot create property 'status' on string 'ConnectionError at /api/auth/registration/register_pro/ Error 99 connecting to localhost:6379. Cannot assign requested address
. The error message prints all the config and environment variables of the Django app, and it shows that everywhere in the app redis_url, result_backend, and broker_url are configured as redis://<NO_USERNAME_HERE>:<REDIS_PASSWORD>@redis:6379
. This should be the correct URL since it works for Celery, but it doesn’t work for Django, which searches for Redis on localhost. I’ve searched the entire app for any references to localhost, but there are none.