Report this

What is the reason for this report?

How to create celery worker on App Platform

Posted on January 4, 2022

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?



This textbox defaults to using Markdown to format your answer.

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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Did you find a workaround?

You should create a job that runs the command celery -A projName worker & this will will create a celery worker and put it in the background. Click “App” on dashboard > “Add compoment” under the project > click “Job”> under “choose source” choose Github > choose the repo and branch and create the app. For celery beat add CELERY_BEAT_SCHEDULER = ‘django_celery_beat.schedulers:DatabaseScheduler’ in settings.py instead.

This comment has been deleted

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.