Skip to main content

A plug-and-play Django app for sending outgoing webhooks on model changes

Project description

Django Model Webhooks

Python Badge PyPI Downloads GitHub

A plug-and-play Django app for sending outgoing webhooks on model changes.

Note: This is a maintained fork of danihodovic/django-webhook, originally created by Dani Hodovic. The upstream project has been inactive since 2024 with unmerged fixes; this fork continues active maintenance, bug fixes, and improvements under the same MIT license. See Credits below.

Django has a built-in signal system which allows programmers to schedule functions to be executed on model changes. django-model-webhooks 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-model-webhooks 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
{
  "topic": "users.User/create",
  "object": {
    "id": 3,
    "name": "Jesse Amarquaye",
    "age": 30
    },
  "object_type": "users.User",
  "webhook_uuid": "5e2ee3ba-905e-4360-94bf-18ef21c0e844"
}

🔥 Features

  • Automatically sends webhooks on model changes
  • Leverages Celery for processing
  • Webhook authentication using HMAC
  • Retries with exponential backoff
  • Admin integration
  • Audit log with past webhook events
  • Protection from replay attacks
  • Allows rotating webhook secrets

📖 Documentation

https://django-webhook.readthedocs.io

Credits

This project began as django-webhook by Dani Hodovic and other upstream contributors. All credit for the original design and implementation goes to them. This fork exists to keep the project maintained, patched, and available on PyPI under active development.

Made with contrib.rocks.

Disclaimer

Django model webhooks is provided as-is and does not require frequent updates. While it remains functional and usable, future updates will be made only if necessary. If you find the project useful but notice a lack of recent activity, this does not mean it is abandoned. Contributions are welcome via pull requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_model_webhooks-0.1.1.tar.gz (379.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_model_webhooks-0.1.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file django_model_webhooks-0.1.1.tar.gz.

File metadata

  • Download URL: django_model_webhooks-0.1.1.tar.gz
  • Upload date:
  • Size: 379.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for django_model_webhooks-0.1.1.tar.gz
Algorithm Hash digest
SHA256 873acf270847ec1bf9f6c5f114e73648ce2c127868f0906f08cb4639477e3ffd
MD5 4e17f11c04e56ca778ac16a83af72ca2
BLAKE2b-256 14c40d5029bac412186ed8a21ebe26baacfa78a2e73492e8142511c6481ed04e

See more details on using hashes here.

File details

Details for the file django_model_webhooks-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_model_webhooks-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ecde6167ba0f06491ffbdec16410b146b971f2ca0ab50cc438d69444200a7e03
MD5 5b3636b23cf039a1b7af2d3033bff182
BLAKE2b-256 71ee8a096f5e2510e53ce476eec58a2db71849b6e1f7733ebd386ddae50793f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page