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 hashes)

Uploaded Source

Built Distribution

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