Webhooks, Django, and ngrok

Working with webhooks can be a pain. In this video learn more of what they are and how to easily work with them in your local environment using ngrok.

resources

curl -X POST http://localhost:9000 -d '{"foo": "bar"}'

views.py

import json

from django.http import HttpResponse
from django.views.generic import View

from braces.views import CsrfExemptMixin


class ProcessHookView(CsrfExemptMixin, View):
    def post(self, request, args, *kwargs):
        print(json.loads(request.body))
        return HttpResponse()
comments powered by Disqus