About Inspecting Webhook Data While Developing
You can check the test data posted to a webhook using Sentry.
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
import sentry_sdk
@csrf_exempt
def webhook(request):
if request.method == "POST":
post_dict = request.POST.dict()
sentry_sdk.set_context("Post Data", post_dict)
sentry_sdk.capture_message("Webhook Triggered")
return HttpResponse("OK")
For security reasons, it's not recommendable to do that with sensitive data like credit card numbers or other secrets.
Tips and Tricks Programming Django 5.x Django 4.2 Django 3.2 Sentry
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.