From c2432ae8cd8744455e8edc35b0a8390964d13a73 Mon Sep 17 00:00:00 2001 From: Andrew Graham-Yooll <andrewgy8@gmail.com> Date: Sat, 18 Jan 2025 20:10:01 +0800 Subject: [PATCH] Update readme installation instructions --- CONTRIBUTORS.md | 2 +- README.md | 38 ++++++++++++++++++++++---------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 429da65..0afba4b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,6 +1,6 @@ # Contributors -This file lists the contributors to the `django_dramatiq` project. +This file lists the contributors to the `Django Dramatiq` project. | Username | Name | | :------- | :--- | diff --git a/README.md b/README.md index 3176950..8b3d8fc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# django_dramatiq +# Django Dramatiq   @@ -6,26 +6,32 @@ [](https://badge.fury.io/py/django-dramatiq) [](https://opensource.org/licenses/Apache-2.0) -**django_dramatiq** is a Django app that integrates with [Dramatiq][dramatiq]. +Seemlessly integrate [Dramatiq][dramatiq] with your Django project! # Contents - - [Installation](#installation) - - [Getting Started](#getting-started) - - [Testing](#testing) - - [Middleware](#middleware) - - [Advanced Usage](#advanced-usage) - - [Third-Party Support](#third-party-support) - - [Example App](#example) + +- [Installation](#installation) +- [Getting Started](#getting-started) +- [Testing](#testing) +- [Middleware](#middleware) +- [Advanced Usage](#advanced-usage) +- [Third-Party Support](#third-party-support) +- [Example App](#example) ## Installation -If you want to install it with RabbitMQ +To install, ensure both Django Dramtiq and Dramatiq are installed, along with RabbitMQ: - pip install django-dramatiq 'dramatiq[rabbitmq, watch]' + pip install django-dramatiq 'dramatiq[rabbitmq]' + +Or with Redis: -Or with Redis + pip install django-dramatiq 'dramatiq[redis]' + +If you would like to install with `watch`: + + pip install django-dramatiq 'dramatiq[rabbitmq, watch]' - pip install django-dramatiq 'dramatiq[redis, watch]' Add `django_dramatiq` to installed apps *before* any of your custom apps: @@ -68,7 +74,7 @@ DRAMATIQ_TASKS_DATABASE = "default" ### Declaring tasks -django_dramatiq will auto-discover tasks defined in `tasks` modules in +Django Dramatiq will auto-discover tasks defined in `tasks` modules in each of your installed apps. For example, if you have an app named `customers`, your tasks for that app should live in a module called `customers.tasks`: @@ -95,7 +101,7 @@ DRAMATIQ_AUTODISCOVER_MODULES = ["tasks", "services"] ### Running workers -django_dramatiq comes with a management command you can use to +Django Dramatiq comes with a management command you can use to auto-discover task modules and run workers: python manage.py rundramatiq @@ -345,7 +351,7 @@ django.setup() ## Example -You can find an example application built with django_dramatiq [here](/examples/basic/README.md). +You can find an example application built with Django Dramatiq [here](/examples/basic/README.md). [dramatiq]: https://github.com/Bogdanp/dramatiq