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-model-webhooks-uuid: 5e2ee3ba-905e-4360-94bf-18ef21c0e844
django-model-webhooks-signature-v1:
django-model-webhooks-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.0.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.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_model_webhooks-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 646cd1c85a62645d0e9a490ab24b1b5a62102c9b1cb6557e6cc043c0e84ee054
MD5 d044da2e798b1897c717e335b65439ba
BLAKE2b-256 575c15e5b4f2a9c1a918551b82ae3d3fd0a3e20291e11ba66ff2200488302596

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_model_webhooks-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33cd8d1570dc67b1a03f5dac2e96dfbb66d2438b9f24306485fb62632594a1b7
MD5 7efb9e87528b03fcd7913890174517fa
BLAKE2b-256 fcbc723029d9ee476aa5026459f3433650f729fe3d97e427363aafca0a82367b

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