Reusable Django app that allows for webhooks to be consumed.
Emits a signal webhook_triggered_signal
when the webhook is triggered. This allows you to provide an action for the
webhook.
This is used by Volt Grid.
Install with pip:
pip install git+https://github.com/voltgrid/django-webhooks.git#egg=webhooks
Add to your Django project in your Python path.
Add webhooks
to your INSTALLED_APPS
.
Set WEB_HOOK_USER
in settings.py
. This must point to a model that provides a user field. Eg:
class User(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=64)
class Meta:
ordering = ['name']
def __unicode__(self):
return "%s" % self.name
Run manage.py syncdb
.
- Checkout the source.
- Install all the requirements
pip install -r requirements.txt.
- Then run
./manage.py test
.
curl -H "Content-Type: application/json" -d "${DATA}" ${URL}
Where $DATA
is JSON payload that will pass the regex, and $URL
is the webhook URL.