A Django package to receive Webhooks from Contentful as signals
Project description
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/. If you’re adding it to the root url configuration the path will be https://example.com/contentful-webook/
Features
TODO
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Development commands
pip install -r requirements_dev.txt invoke -l
Credits
Tools used in rendering this package:
History
0.5.0 (2023-12-07)
Add Django 5.0 compatibility
Add Python 3.12 compatibility
0.4.0 (2022-12-21)
Deprecate Django 3.1 compatibility
Add option to not log contentful webhook invocations with the LOG_CONTENTFUL_WEBHOOKS setting
0.3.0 (2022-06-04)
Add Django 4.0 compatibility
0.2.0 (2021-02-16)
Change receiver url from hook/ to contentful-webhook/
0.1.0 (2021-02-15)
First release on PyPI.
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
Built Distribution
Hashes for contentful-webhook-receiver-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a21325e7df323aa312c21c08b34b80c148d82adf546429c8aa1563ef271d7af |
|
MD5 | d68e85c817a0edc1ab294ab395d9ba72 |
|
BLAKE2b-256 | 96428f4ba2703468ba7fb19c7a945547eefc1f049f93f33b028419290b4eb4c9 |
Hashes for contentful_webhook_receiver-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0334ce4ed98a3be2d03d952b3c3af2275d50f802d5372370dbf7ae5faeddf2fd |
|
MD5 | 9418673dca7b0f9bb7f20306e8ff052c |
|
BLAKE2b-256 | b3d59c78aaabdb0c51be753dba1b21a6ee6f85902deca7572104cd9781336a9e |