How to run the qcluster process in production (Django-q)?

Viewed 414

I have a Django webapp. The app has some scheduled tasks, for this I'm using django-q. In local development you need to run manage.py qcluster to be able to run the scheduled tasks.

How can I automatically run the qcluster process in production?

I'm deploying to a Digital Ocean droplet, using ubuntu, nginx and gunicorn.

1 Answers

Are you using a Procfile?

My configuration is to have a Procfile that contains:

web: python ./manage.py runserver 0.0.0.0:$PORT
worker: python ./manage.py qcluster

This way, every time the web process is started, another process for django-q is also created.

Related