Closed garethjax closed 1 month ago
Hi,
This project already installs the psycopg library btw. You can see it referenced here in the connection string: https://github.com/nickjj/docker-flask-example/blob/b31f76fe9eb282c1a850b074db18433bcf9304e6/config/settings.py#L16
As for the issue around using postgres as your back-end, you didn't include what you have set for that so I'm not sure. You probably need to use postgresql+psycopg
not postgresql
.
I'd suggest checking out their docs: http://docs.celeryproject.org/en/latest/userguide/configuration.html#database-backend-settings
Sorry, I'm going to close this one as it's not related to this project and I haven't use Postgres as a results back-end for Celery. Feel free to reply back if get it working though.
the premise is that i'm trying to understand how this configuration works (and probably i'm being WAY ahead of myself).
I have a bit of experience with docker and python but it's not my main activity.
Since i want to do manage task with celery, but i want to keep a proper log of the activities, i was thinking about using redis as the broker url and postgress as the result_backend.
So i've tried this config (by asking ChatGPT.... i know, i know)
Celery.
CELERY_CONFIG = { "broker_url": os.getenv("REDIS_URL", "redis://redis:6379/0"), "result_backend": os.getenv("DATABASE_URL", db), "include": [], }
But when i try to rebuild the containers, the worker images display this error:
things i've tried
i've altered the dockerfile to include a pip install
But i'm still having the error.
What i'm doing wrong ?