I am able to run redis locally and everything works.
However when I deploy to heroku I get this error:
Error 111 connecting to localhost:6379. Conn
if anyone comes here trying to get django_rq to work after encountering either 99 or 111 errors try the following:
RQ_QUEUES = {
"default": {
"HOST": "redis",
"PORT": "6379",
"URL": os.getenv("REDISTOGO_URL", "redis://redis:6379"), # If you're
"DB": 0,
"DEFAULT_TIMEOUT": 480,
}
}
this requires you to name the redis container like this in your docker-compose.yml
services:
app:
build:
context: .
ports:
- "8000:8000"
volumes:
- ./app:/app
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
depends_on:
- redis
redis:
image: redis:6-alpine
ports:
- "6379:6379"