Question

How to create celery worker on App Platform

Posted 1 day ago 41 views
DjangoRedisDigitalOcean App Platform

I am trying to add celery + redis to my django app that is hosted on DO App Platform. I understand there is an issue I need to work around that is documented here: https://www.digitalocean.com/community/questions/is-there-an-issue-with-celery-on-app-platform

My problem is that I cannot even get to that point. Django celery and celery beat is working fine locally i.e. I can schedule and run background tasks. I start the celery worker using:

celery -A my_project.celery worker -l info

And the celery beat worker using:

celery -A my_project beat -l info

I cannot figure out how to do this on DO App platform.

A couple of tutorials simply say you need to create a worker in DO. What exactly does this mean? Don’t I just need to run these commands somehow? Do I need another virtual environment or will the worker use the same one from my django app (like it does when run locally). When I try to create a worker on DO it wants me to create another app.

Could anybody point me to an example of how all of this is supposed to work?

Would you be able to give some more information on how to create the celery worker please? Where exactly do I run the command to start the worker?

Would you have an example of the code you used to create the worker?

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!