Django Broadcaster
A Django app that implements the transactional outbox pattern with CloudEvents support, enabling reliable event publishing in distributed systems.
Features
- 🔄 Transactional Broadcaster Pattern: Ensures events are published reliably
- ☁️ CloudEvents Compatible: Follows CloudEvents specification
- 🔌 Multiple Backends: Redis Streams, Kafka, NATS support
- 🔁 Retry Logic: Exponential backoff with configurable retries
- 🔑 Idempotency: Prevents duplicate event processing
- 📊 Monitoring: Built-in metrics and health checks
- 🎯 Event Handlers: Local event processing framework
- 🔧 Admin Interface: Django admin integration
Quick Start
Installation
# Using pip
pip install django-broadcaster
# Using uv
uv add django-broadcaster
Configuration
Add to your Django settings:
INSTALLED_APPS = [
# ... your other apps
'django_broadcaster',
]
OUTBOX_PUBLISHERS = {
'default': {
'BACKEND': 'django_broadcaster.backends.RedisStreamBackend',
'OPTIONS': {
'host': 'localhost',
'port': 6379,
'stream_name': 'events',
}
}
}
Usage
from django_broadcaster.publishers import publisher
# Publish an event
event = publisher.publish_event(
event_type='user.created',
source='user-service',
data={'user_id': 123, 'email': 'user@example.com'}
)
# Register event handler
from django_broadcaster.registry import event_registry
@event_registry.register('user.created')
def handle_user_created(event):
print(f"User created: {event.data}")
Running the Worker
python manage.py outbox_worker
Documentation
Full documentation is available at https://django-broadcaster.readthedocs.io/en/latest/.
Building and Serving Documentation Locally
To build the documentation locally:
# Build the documentation
make docs-build
# Serve the documentation locally at http://localhost:8080
make docs-serve
After running make docs-serve, you can access the documentation by opening http://localhost:8080 in your web browser.
Contributing
Contributions are welcome! Please read our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for django-broadcaster 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_broadcaster-0.1.1.tar.gz | 36.4 kB | Without provenance | Details for django_broadcaster-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_broadcaster-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for django_broadcaster-0.1.1-py3-none-any.whl |
Total release size: 53.0 kB
Release files / django_broadcaster-0.1.1.tar.gz
| Download URL | django_broadcaster-0.1.1.tar.gz |
|---|---|
| Size | 36.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1108ecf9e2a4d5b6554ba113660b8dc3823e1655ef9d5ea4556014ff350e0b41
|
|
BLAKE2b-256 checksum How to use checksums |
cae6008ec1f38c8e11dc44447c0fe5918d81b61a69a3f87bdbcc93e58428d583
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.12
|
Release files / django_broadcaster-0.1.1-py3-none-any.whl
| Download URL | django_broadcaster-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
34394984cf7c398388a70f9dc06958bd3d69363e278706570943ab298f376c13
|
|
BLAKE2b-256 checksum How to use checksums |
dc334c5e6fbf547ec56e7d09ccc2c1758ec38bd48cf426eb4a538a37fe0c14d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.12
|
Security for django-broadcaster 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.