Django WebHooks makes it easy to integrate WebHooks into your Django Project.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Django WebHooks


Web Hooks is an open initiative to standardize event notifications between web services by subscribing to URLs.

Django WebHooks makes it easy to integrate WebHooks into your Django Project.

Using Django Webhooks

  1. Download the code from GitHub:

     git clone git:// webhooks
  2. Edit and add webhooks to your INSTALLED_APPS:

     INSTALLED_APPS = (... 'webhooks', ...)
  3. Register webhooks for models - is a good place:

     from webhooks import webhooks
     webhooks.register(MyModel, ["fields", "to", "serialize"])
  4. Create Listeners for the webhook. For example to create a Listener that will be messaged whenever a User instance with username="john" is saved:

     from django.contrib.auth.models import User
     from django.contrib.contenttypes.models import ContentType
     from webhooks.models import Listener
     user_type = ContentType.objects.get(app_label="auth", model="user")
     john = User.objects.get(username="john")
  5. Profit.

Creating a Webhook Endpoint

  1. Django:

     import simplejson
     def listener(request):
         json = request.raw_post_data
         webhook = simplejson.loads(json)
  2. PHP:

     $json = file_get_contents('php://input');
     var_dump(json_decode($json, true));


  1. HTTP POST request / raw_post_data
  2. Creating a listener ...
  3. ...


  1. Code in webhooks.models.Message should be moved into webhooks.helpers so it can be subclassed / overridden more easily.
  2. Add HMAC authorization headers to all Webhooks messages ([](see Google Code implementation)
  3. Add verify view for (think PayPal IPN)