Skip to main content

A Django package to receive Webhooks from Contentful as signals

Project description

Contentful Webhook Receiver

image

image

image

A Django package to receive Webhooks from Contentful as signals

Documentation

The full documentation is at https://contentful-webhook-receiver.readthedocs.io.

Quickstart

Install Contentful Webhook Receiver:

pip install contentful-webhook-receiver

Add it to your `INSTALLED_APPS`:

INSTALLED_APPS = (
    ...
    'contentful_webhook_receiver.apps.ContentfulWebhookReceiverConfig',
    ...
)

Add Contentful Webhook Receiver's URL patterns:

from contentful_webhook_receiver import urls as contentful_webhook_receiver_urls


urlpatterns = [
    ...
    path(r'^', include(contentful_webhook_receiver_urls)),
    ...
]

Listen for the Contentful Webhook Receiver signal:

@receiver(contentful_publish_entry)
def entry_published(sender, instance: WebhookInvocation, **kwargs):
    print(instance.data['sys']['content_type']['id'])

Register a Webhook on Contentful:

The path added to the urlpatterns is [contentful-webhook/]{.title-ref}. If you're adding it to the root url configuration the path will be [https://example.com/contentful-webook/]{.title-ref}

Features

  • TODO

Running Tests

Does the code actually work?

poetry run tox

Development commands

poetry install --with=dev

Cutting new release -------

poetry version <patch|minor|major>
# Update changelog
git add CHANGELOG.md pyproject.toml contentful_webhook_receiver/__init__.py
NEW_RELEASE=$(poetry version --short)
git commit -m "Release $NEW_RELEASE"
git tag $NEW_RELEASE
git push --tags

Credits

Tools used in rendering this package:

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

contentful_webhook_receiver-0.7.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file contentful_webhook_receiver-0.7.0.tar.gz.

File metadata

  • Download URL: contentful_webhook_receiver-0.7.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

File hashes

Hashes for contentful_webhook_receiver-0.7.0.tar.gz
Algorithm Hash digest
SHA256 3f564da7e0cd210749a5bccf864ffe365235b3aa82045ad25efb6db9f1380f43
MD5 fccbf79a84d5bd641b296b4ee40fdbf7
BLAKE2b-256 2f17583c6b996f904d4f58a26e05e500676bed18d6be2c8ac7efb378ebb0fdfe

See more details on using hashes here.

File details

Details for the file contentful_webhook_receiver-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for contentful_webhook_receiver-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 390f37c50d0dc7b40002cf615087107b593e7eaed4adeb14cfc9ac5f60b9946c
MD5 335864f3452efa7ba0b2da8c349a7572
BLAKE2b-256 0f843a2daa36d6ae8391da9f804dc038a4fc6843c47f96e7bc12b25d1bb8efb6

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