Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ _These features can be enabled during initial project setup._

- Serve static files from Amazon S3, Google Cloud Storage, Azure Storage or [Whitenoise](https://whitenoise.readthedocs.io/)
- Configuration for [Celery](https://docs.celeryq.dev) and [Flower](https://github.com/mher/flower) (the latter in Docker setup only)
- Configuration for [Django-RQ](https://github.com/rq/django-rq) with [Valkey](https://valkey.io/) as an alternative task queue
- Integration with [Mailpit](https://github.com/axllent/mailpit/) for local email testing
- Integration with [Sentry](https://sentry.io/welcome/) for error logging

Expand Down
1 change: 1 addition & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"use_drf": "n",
"frontend_pipeline": ["None", "Django Compressor", "Gulp", "Webpack"],
"use_celery": "n",
"use_django_rq": "n",
Comment on lines 37 to +38
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use_celery and use_django_rq be mutually exclusive, or allow both for advanced setups?

AFAIU, Celery and RQ are solving the same problem, so we should design the questions to avoid having both installed. I would change this question to something like "background_queue": ["None", "Celery", "Django-RQ"]. Basically turn 2 Y/N questions into one drop-down question.

"use_mailpit": "n",
"use_sentry": "n",
"use_whitenoise": "n",
Expand Down
7 changes: 7 additions & 0 deletions docs/1-getting-started/project-generation-options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ Both Gulp and Webpack support Bootstrap recompilation with real-time variables a
use_celery:
Indicates whether the project should be configured to use Celery_.

use_django_rq:
Indicates whether the project should be configured to use Django-RQ_ with Valkey_ as an alternative task queue to Celery. Django-RQ provides a simpler, more lightweight approach to background task processing.

use_mailpit:
Indicates whether the project should be configured to use Mailpit_.

Expand Down Expand Up @@ -182,6 +185,10 @@ debug:

.. _Celery: https://github.com/celery/celery

.. _Django-RQ: https://github.com/rq/django-rq

.. _Valkey: https://valkey.io/

.. _Mailpit: https://github.com/axllent/mailpit

.. _Sentry: https://github.com/getsentry/sentry
Expand Down
29 changes: 29 additions & 0 deletions docs/2-local-development/developing-locally-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,35 @@ By default, it's enabled both in local and production environments (``docker-com

.. _`Flower`: https://github.com/mher/flower

Django-RQ (Optional Task Queue)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you selected ``use_django_rq`` during project initialization, you can use Django-RQ with Valkey for background task processing.

**Services included:**

* **Valkey**: Redis-compatible data store on port 6379
* **RQ Worker**: Processes background jobs from queues
* **RQ Scheduler**: Handles scheduled/periodic tasks
* **RQ Dashboard**: Web-based monitoring at http://localhost:9181

**Quick example:**

.. code-block:: python

# myapp/tasks.py
import django_rq

@django_rq.job
def send_notification(user_id):
# Task code here
pass

# Enqueue from anywhere
send_notification.delay(user_id)

See the :doc:`/4-guides/using-django-rq` guide for complete documentation.

Using Webpack or Gulp
~~~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 10 additions & 1 deletion docs/3-deployment/deployment-with-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Before you begin, check out the ``docker-compose.production.yml`` file in the ro

* ``django``: your application running behind ``Gunicorn``;
* ``postgres``: PostgreSQL database with the application's relational data;
* ``redis``: Redis instance for caching;
* ``redis``: Redis instance for caching (and Celery if enabled);
* ``valkey``: Valkey instance for Django-RQ task queue (if ``use_django_rq`` is enabled);
* ``traefik``: Traefik reverse proxy with HTTPS on by default.

Provided you have opted for Celery (via setting ``use_celery`` to ``y``) there are three more services:
Expand All @@ -31,6 +32,14 @@ The ``flower`` service is served by Traefik over HTTPS, through the port ``5555`

.. _`Flower`: https://github.com/mher/flower

If you have opted for Django-RQ (via setting ``use_django_rq`` to ``y``) there are three additional services:

* ``rqworker`` running an RQ worker process;
* ``rqscheduler`` running an RQ scheduler process;
* ``rqdashboard`` running the RQ Dashboard monitoring interface.

The ``rqdashboard`` service is served by Traefik over HTTPS, through the port ``9181``. For more information about Django-RQ, check out :doc:`/4-guides/using-django-rq`.


Configuring the Stack
---------------------
Expand Down
Loading
Loading