Skip to main content

A Django app to for webhooks.

Project description

Mad Webhooks

Mad webooks app for django to webhooks to the user

Quick start

Add "mad_webhooks" to your INSTALLED_APPS setting like this:

INSTALLED_APPS = [
    ...
    'mad_webhooks',
]

Include the middlewre at the end in your settings like this:

MIDDLEWARE = [
    ...
    "mad_webhooks.middleware.getWebhookMiddlewareClass",
]

Run python manage.py migrate to create mad_webhooks models.

Overriding Default Classes

Update your project settings

"MAD_WEBHOOKS_WEBHOOK_MODEL": "mad_webhooks.Webhook",
"MAD_WEBHOOKS_EVENTS_MODEL": "mad_webhooks.Event",
"MAD_WEBHOOKS_WEBHOOK_EVENT_POST_ATTEMPT_MODEL": "mad_webhooks.WebhookEventPostAttempt",
"MAD_WEBHOOKS_LOG_MODEL": "mad_webhooks.Log",

MAD_WEBHOOKS = {
    "WEBHOOK_ADMIN_CLASS": "mad_webhooks.admin.WebhookAdmin",
    "WEBHOOKS_WEBHOOK_EVENT_POST_ATTEMPT_ADMIN_CLASS": "mad_webhooks.admin.WebhookEventPostAttemptAdmin",
    "EVENT_ADMIN_CLASS": "mad_webhooks.admin.EventAdmin",
    "LOG_ADMIN_CLASS": "mad_webhooks.admin.LogAdmin",

    "GET_USER_TOKEN_CLASS": "mad_webhooks.application.GetUserTokenClass",
    "GET_ACCESS_TOKEN_CLASS": "mad_webhooks.application.GetAccessTokenClass",
    "GET_ACCESS_TOKEN_DETAILS_CLASS": "mad_webhooks.application.GetAccessTokenDetailsClass",
    "GET_APPLICATION_DATA_FROM_REQUEST_CLASS": "mad_webhooks.application.GetApplicationDataFromRequestClass",
    "GET_WEBHOOK_MIDDLEWARE_CLASS": "mad_webhooks.middleware.Webhook",

    "CREATE_LOG_CLASS": "mad_webhooks.webhook.CreateLogClass",
    "POST_EVENT_TO_WEBHOOK_CLASS": "mad_webhooks.webhook.PostEventToWebhookClass"
}

see existing class for override reference.

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

mad_webhooks-2.1.2.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file mad_webhooks-2.1.2.tar.gz.

File metadata

  • Download URL: mad_webhooks-2.1.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for mad_webhooks-2.1.2.tar.gz
Algorithm Hash digest
SHA256 fa67aaf76deeabdf358fa85ba4b0c2af73081d6645292653a45620d8feb0c876
MD5 4e49a0876404069b8cd416294b42c51a
BLAKE2b-256 0daa28fb878b66a6f730fbefda5a7964ce3c04f7193afa8bb700307cd4d2b628

See more details on using hashes here.

Supported by

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