Registry / devops / django-signal-webhooks

django-signal-webhooks

JSON →
library0.3.1pypypiunverified

Add webhooks to Django using signals. Current version 0.3.1, released under MIT license. Actively maintained, but low release cadence.

pip install django-signal-webhooks
INSTALL
IMPORT
SIG · DJANGO-SIGNAL-WEBH
D
django-signal-webhooks
devopspythonv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SignalWebhookReceiver
from signal_webhooks import SignalWebhookReceiver
from signal_webhooks.models import SignalWebhookReceiver

Setup: add to INSTALLED_APPS, run migrations, create a SignalWebhookReceiver instance, and mixin to your model.

import os os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings' import django django.setup() # Add 'signal_webhooks' to INSTALLED_APPS, then: from signal_webhooks.models import SignalWebhookReceiver, SignalWebhookSenderMixin from myapp.models import MyModel # Create a receiver that listens to the desired signal class MyReceiver(SignalWebhookReceiver): signal = 'myapp.mymodel.post_save' url = 'https://example.com/webhook/' MyReceiver.objects.get_or_create(url='https://example.com/webhook/') # Mixin usage in model class MyModel(SignalWebhookSenderMixin, models.Model): pass # Optionally manually dispatch from signal_webhooks.signals import webhook_signal webhook_signal.send(sender=MyModel, instance=None, event='myapp.mymodel.post_save')
Debug
Known issues
breakingDjango version requirement: library requires Python >=3.9 and Django <4, >=3.2. Using with Django 4+ may cause issues.
fix
Use version 0.3.1 intended for Django 3.2-4.0 compatibility. For Django 4+, consider alternatives.
affects: <0.3.1
deprecatedSignalWebhookReceiver.signal field expects a string format 'app_label.model.signal_name'. Documentation may be ambiguous.
fix
Ensure signal string matches exactly, e.g., 'myapp.mymodel.post_save'.
affects: all
gotchaSender mixin only works with model signals. Custom signals may not be automatically captured.
fix
Manually dispatch webhook_signal.send() for non-model signals.
affects: all
gotchaMigration needed after adding to INSTALLED_APPS. Forgetting to run migrate will cause 'no such table' errors.
fix
Run 'python manage.py migrate signal_webhooks'.
affects: all
Upgrade
Version history
0.3.1latest on PyPI · released Oct 31, 2024
Audit
Dependencies
djangorequiredCore dependency; requires Django >= 3.2
requestsrequiredHTTP client for sending webhooks
Agent activity
21 hits · last 30 days
node
18
Resources
django-signal-webhooks — pip install django-signal-webhooks · libregistry