This example shows how to create Django application with Celery.
The prerequisites of using the starter example are the following:
Enter the project directory, e.g.
$ cd django-celeryCreate a Python virtual environment,
$ python -m venv .venvActivate the virtual environment,
$ source .venv/bin/activateFor your IDE, point the Python interpreter to this .venv.
Build docker images,
$ docker compose buildUp dev environment,
$ docker compose upVisit http://127.0.0.1:8000/ for app development.
Celery worker broker is using Redis.
Use Celery flower to monitor the worker, queue and job status.
Flower http://127.0.0.1:5000/.
Enter the app container,
$ docker-compose exec app bashAfter entered into the container, then create a superuser for local development.
$ python manage.py createsuperuserThen use the credentials to login to the admin page,
Admin http://127.0.0.1:8000/admin
Django celery results extension has been installed, and has db migration, you can check the tables on Admin panel.
- https://github.com/celery/django-celery-results
- https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html
Celery result: 127.0.0.1:8000/admin/django_celery_results/taskresult/.