Deploying Django application that is using Celery and Redis might be challenging. Thanks to docker-compose
tool we can prepare docker containers locally and make deployment much easier. I would like to show you my approach for constructing docker-compose
configuration that can be reused in other web applications. I will be using Django version 4.1.3
and Celery 5.2.7
. The nginx server will be used as reverse proxy for Django and to serve static files. Postgres database and Redis will be in the docker-compose
.
React and Django Free Boilerplate
Learn how to write SaaS application with React and Django from scratch
Contact us for any questions by filling a form.
Topic: Celery
-
Docker compose with Django 4, Celery, Redis and Postgres
Celery Django Redis Postgres Nginx Docker Aleksandra Płońska, Piotr Płoński, November 17, 2022
-
Dynamically update periodic tasks in Celery and Django
Celery Django-rest-framework Aleksandra Płońska, Piotr Płoński, October 17, 2022
Celery is a popular distributed tasks queue. It is often used with Django framework to process heavy computational tasks in the background. You can add a single task to the queue or define periodic tasks. Periodic tasks are automatically scheduled for execution based on set time. The most common approach is to define the periodic tasks before the Celery worker is started. For example, it can be daily cleaning of the database. What if we would like to define periodic tasks dynamically? Recently, I’ve been working on a web app for uptime monitoring. The service continuously monitors a server and send email notification when the server is down. In the web app, the user can add a server address to be monitored and select the interval between requests to the server. How to dynamically add periodic tasks in Celery? I want to describe my approach in this article.