cloudblue/django-cqrs
54.9
Weak · 22 September 2026
4.5k
lines of production code
Python
primary language
7
measurements over time
What this system is
This system is a Django library (dj\_cqrs) that implements Command Query Responsibility Segregation (CQRS) to synchronize data between master and replica databases. It handles message routing and consumption via RabbitMQ or Redis, providing robust features for bulk data operations, dead-letter queue management, and configurable retry mechanisms. The package includes management commands and admin tools to facilitate data replication, synchronization, and monitoring across different database backends.
How it got here
2019 — CQRS architecture and test suite expansion
16 changes.
The project implemented core CQRS components, including a new controller layer for message routing and dedicated RabbitMQ and Kombu transport implementations with advanced error handling. This architectural work was accompanied by the creation of a comprehensive test suite covering unit, integration, and management command scenarios across multiple database backends.
2021 — CQRS demo project and dependency modernization
4 changes.
This period focused on introducing Poetry-based dependency management and updating development tooling. It also involved creating a comprehensive CQRS demo project that illustrates the library's architecture using separate master and replica Django services with RabbitMQ, PostgreSQL, MySQL, and Redis.
Features
Added demo project master service with CQRS-enabled Django models
The master\_service example now includes a Django application that defines User, Product, ProductType, and Purchase models. These models integrate with the dj\_cqrs library via MasterMixin to enable Command Query Responsibility Segregation, publishing events to RabbitMQ. The service provides basic CRUD views for managing these entities and includes initial database migrations along with a data migration that seeds sample users and products.
_examples/demo\_project/master\service · high confidence
Added demo replica service example
A new Django-based demo application (\replica\_service\) has been added to the examples directory to illustrate the usage of the \dj\_cqrs\ library. This example includes a complete project structure with models for Users, Products, and Purchases, demonstrating both standard field replication and custom CQRS serialization logic. It is configured to connect to a MySQL database for persistent storage and Redis for caching purchase data, while using RabbitMQ as the message transport for synchronization.
_examples/demo\_project/replica\service · high confidence
New CQRS demo project example
Added a new \examples/demo\_project\ that demonstrates a CQRS architecture using two Django services: a master service storing data in PostgreSQL and a replica service replicating data to MySQL and Redis. The example includes Docker Compose configuration to orchestrate the services, RabbitMQ for the CQRS transport, and web interfaces for both services to interact with Users, Products, and Purchases.
examples · high confidence
New CQRS management commands for bulk I/O, synchronization, and dead-letter handling
This change introduces a suite of new Django management commands in the dj\_cqrs/management package to support bulk data operations, replication synchronization, and message queue management. The new commands include cqrs\_bulk\_dump and cqrs\_bulk\_load for exporting and importing CQRS model data in batches, cqrs\_sync and cqrs\_diff\_sync for filtering and synchronizing model rows to replicas with progress tracking, and cqrs\_consume for starting worker processes with optional auto-reload. Additionally, commands for managing dead-letter queues (cqrs\_dead\_letters), detecting deleted objects (cqrs\_deleted\_diff\_master, cqrs\_deleted\_diff\_replica, cqrs\_deleted\_sync\_replica), and streaming diffs (cqrs\_diff\_master, cqrs\_diff\_replica) are added. These commands provide granular control over CQRS data flow, allowing users to specify batch sizes, filters, and output destinations, while also improving error handling and connection resilience during synchronization tasks.
_dj\cqrs/management · high confidence
Architecture
Migration to GitHub Actions and MkDocs documentation
The project has replaced its legacy Jenkins CI pipeline with GitHub Actions workflows, enabling automated builds and integration tests via \docker compose\. Documentation has been modernized by switching from ReadTheDocs to MkDocs, with a new \mkdocs.yml\ configuration and a \.readthedocs.yaml\ file to support the new build system. The repository structure has been cleaned up by removing the old \setup.py\ and \VERSION\ files, updating the \.gitignore\ to exclude new build artifacts, and refining the \MANIFEST.in\ to exclude test and documentation directories from the installed package.
(repo-wide) · high confidence
Behavioural changes
CQRS configuration validation and Django Admin sync action
The dj\_cqrs package now validates CQRS settings at startup, ensuring the transport is correctly configured and that master/replica settings (such as message TTL, retries, and correlation functions) meet expected types and constraints. Additionally, a new CQRSAdminMasterSyncMixin is available for Django Admin, allowing administrators to manually trigger CQRS synchronization for selected master model instances directly from the admin interface.
_dj\cqrs · high confidence
New CQRS controller layer for message routing and consumption
This change introduces the \dj\_cqrs.controller\ package, which centralizes the logic for handling CQRS messages. The \producer\ module now delegates message sending to the configured transport layer via \current\_transport.produce()\. The \consumer\ module provides a \consume\ entry point that processes incoming payloads by routing signals (SAVE, DELETE, SYNC) to the appropriate replica model methods. Key behavioral updates include copying payloads to prevent mutation, enforcing direct-sync restrictions via the \CQRS\_ONLY\_DIRECT\_SYNCS\ setting, supporting metadata via \CQRS\_META\, and handling database connection management and query timeouts for replica operations.
_dj\cqrs/controller · high confidence
New RabbitMQ and Kombu transport implementations with advanced message handling
The dj\_cqrs/transport module now includes dedicated transport implementations for RabbitMQ (using pika) and Kombu, replacing the previous generic structure. These transports introduce several behavioral changes: messages that fail processing or are malformed are explicitly rejected without requeuing (nack/reject with requeue=False), preventing infinite loops for bad data. The RabbitMQ transport adds support for manual acknowledgment, dead letter queues for expired messages, and a delay queue mechanism for retrying failed messages with configurable delays. Additionally, the consumer now supports filtering by specific CQRS IDs via an optional argument, and the RabbitMQ exchange is configured as durable. A LoggingMixin has been added to provide detailed, structured logging for all transport operations (produced, consumed, accepted, denied, failed, delayed, requeued, dead-lettered).
_dj\cqrs/transport · high confidence
Test coverage
Added Django test configuration and transport stubs; Added comprehensive test suite for Master model CQRS functionality; Added comprehensive tests for CQRS management commands; Added integration tests for CQRS replication and message handling; Added test coverage for Django management commands; Added test fixtures for Django master model serialization and tracking; Added test models for dj\_replica; Added tests for replica signal routing and mixin operations; Added unit tests for transport implementations; Initial test suite for Django CQRS library; New Dockerized integration test environment for CQRS transport compatibility.
Dependencies
Introduce Poetry-based dependency management and example project scaffolding
The project now uses Poetry for dependency management, adding a \pyproject.toml\ and \poetry.lock\ file that define the library as version 27.0.0 with support for Django 3.2 through 5.x and Python 3.10 through 3.12. An example demo project has been added under \examples/demo\_project/\, containing \master\_service\ and \replica\_service\ directories with their own \requirements.txt\ files pinning Django 3.2.20 and related dependencies like \djangorestframework\ and \django-cqrs\. Development tooling has also been updated to include Black 23.12.1 for code formatting and various flake8 plugins for linting.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 52 → 55 (+2.5)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 98 (-1.4)
- Architecture 100 → 95 (-5.2)
- Maturity 40 → 43 (+3.4)
- Readiness 64 → 51 (-13.3)
- Security 52 → 65 (+12.7)
Resolved (39)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (14 lines × 2) (dj_cqrs/management/commands/cqrs_deleted_diff_replica.py)
- Duplicated block (20 lines × 3) (dj_cqrs/management/commands/cqrs_bulk_dump.py)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 19 more
New (62)
- Banned license: mysqlclient
- Command.handle (cognitive 16) (dj_cqrs/management/commands/cqrs_bulk_dump.py)
- Command.handle (cognitive 18) (dj_cqrs/management/commands/cqrs_sync.py)
- Critical CVE: [GHSA redacted] (poetry.lock)
- Documentation: no installation or build instructions (README.md)
- Duplicated block (11 lines × 2) (examples/demo_project/master_service/manage.py)
- Duplicated block (19 lines × 2) (dj_cqrs/management/commands/cqrs_deleted_diff_replica.py)
- Duplicated block (21 lines × 3) (dj_cqrs/management/commands/cqrs_bulk_dump.py)
- Duplicated block (7 lines × 2) (dj_cqrs/management/commands/cqrs_bulk_dump.py)
- Duplicated block (7 lines × 2) (dj_cqrs/management/commands/cqrs_deleted_diff_master.py)
- Duplicated block (7 lines × 2) (dj_cqrs/management/commands/cqrs_deleted_sync_replica.py)
- Duplicated block (7 lines × 3) (dj_cqrs/management/commands/cqrs_bulk_dump.py)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High CVE: [GHSA redacted] (poetry.lock)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 42 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
cloudblue/django-cqrs was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 22 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b93ad07a58abc687c4c6af8d94b3d3752c2fc8b2 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-821afab8930d.