Send outgoing webhooks on Django model changes, reliably.
Project description
Django Webhooks 
A plug-and-play Django app for sending outgoing webhooks on model changes.
Published on PyPI as
django-webhook2. This is a reliability-focused fork ofdjango-webhookby Dani Hodovic. The Python import path is unchanged (django_webhook), so it remains a drop-in replacement — install withpip install django-webhook2.
Django has a built-in signal system which allows programmers to schedule functions to be executed on model changes. django-webhook leverages the signal system together with Celery to send HTTP requests when models change.
Suppose we have a User model
class User(models.Model):
name = models.CharField(max_length=50)
age = models.PositiveIntegerField()
If a webhook is configured, any time the above model is created, updated or deleted django-webhook will send an outgoing HTTP request to a third party:
POST HTTP/1.1
host: webhook.site
user-agent: python-urllib3/2.0.3
django-webhook-uuid: 5e2ee3ba-905e-4360-94bf-18ef21c0e844
django-webhook-signature-v1:
django-webhook-request-timestamp: 1697818014
{
"event_id": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed",
"occurred_at": "2023-10-20T18:06:54+00:00",
"topic": "users.User/create",
"object": {
"id": 3,
"name": "Dani Doo",
"age": 30
},
"object_type": "users.User",
"webhook_uuid": "5e2ee3ba-905e-4360-94bf-18ef21c0e844"
}
🔥 Features
- Automatically sends webhooks on model changes
- Dispatch only after the database transaction commits — a rollback never publishes
- Event production is isolated from the writer: a serializer or broker error can never fail
save() - Leverages Celery for processing
- Webhook authentication using HMAC
- Retries every failure mode (connection, timeout, error response) with exponential backoff
- Configurable request timeout
- Per-event id and occurrence time in the envelope for safe dedup/ordering
- Manual re-send of recorded deliveries, from the admin or programmatically
- Independent retention windows for succeeded and failed deliveries
- Pluggable per-model payload serializers
- Public emission API for set-based writes (
QuerySet.update,bulk_create,bulk_update) - Admin integration (configurable admin site)
- Audit log with past webhook events
- Protection from replay attacks
- Allows rotating webhook secrets
📖 Documentation
https://django-webhook2.readthedocs.io
Contributors
Made with contrib.rocks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_webhook2-0.9.0.tar.gz.
File metadata
- Download URL: django_webhook2-0.9.0.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49ba102cf8d0b608d1b4e02c272c901200e071efb0f006631fa9fce873143fbf
|
|
| MD5 |
aece129de412db3ac3a64b8b6e309e7c
|
|
| BLAKE2b-256 |
9d583f93caffe02a5fa62fa17e03be5687b540c2113384791f2d907f906b080f
|
Provenance
The following attestation bundles were made for django_webhook2-0.9.0.tar.gz:
Publisher:
publish.yml on edi-monefy/django-webhook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_webhook2-0.9.0.tar.gz -
Subject digest:
49ba102cf8d0b608d1b4e02c272c901200e071efb0f006631fa9fce873143fbf - Sigstore transparency entry: 2191058427
- Sigstore integration time:
-
Permalink:
edi-monefy/django-webhook@7d006c4afafd2c4b82fdfc84b12442881c2bc6f9 -
Branch / Tag:
refs/tags/0.9.0 - Owner: https://github.com/edi-monefy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7d006c4afafd2c4b82fdfc84b12442881c2bc6f9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_webhook2-0.9.0-py3-none-any.whl.
File metadata
- Download URL: django_webhook2-0.9.0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36ac4c0b40d43d7e26994ad22b1b9938890cf223664e2465e744d96f1e8fbd40
|
|
| MD5 |
49c28c612d0d22df2e6251bd62b967f6
|
|
| BLAKE2b-256 |
98410252584e7a06007c2b7cbbea0b4abc752f93ee3078873d596c29ecb3d909
|
Provenance
The following attestation bundles were made for django_webhook2-0.9.0-py3-none-any.whl:
Publisher:
publish.yml on edi-monefy/django-webhook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_webhook2-0.9.0-py3-none-any.whl -
Subject digest:
36ac4c0b40d43d7e26994ad22b1b9938890cf223664e2465e744d96f1e8fbd40 - Sigstore transparency entry: 2191058657
- Sigstore integration time:
-
Permalink:
edi-monefy/django-webhook@7d006c4afafd2c4b82fdfc84b12442881c2bc6f9 -
Branch / Tag:
refs/tags/0.9.0 - Owner: https://github.com/edi-monefy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7d006c4afafd2c4b82fdfc84b12442881c2bc6f9 -
Trigger Event:
push
-
Statement type: