{ "info": { "author": "Byron Ruth", "author_email": "b@devel.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP" ], "description": "# django-webhooks\n\n[![Build Status](https://travis-ci.org/cbmi/django-webhooks.png?branch=master)](https://travis-ci.org/cbmi/django-webhooks)\n[![Coverage Status](https://coveralls.io/repos/cbmi/django-webhooks/badge.png?branch=master)](https://coveralls.io/r/cbmi/django-webhooks?branch=master)\n\n\n\n## Install\n\n```bash\n# Yes.. with a two on the end\npip install django-webhooks2\n```\n\n## Setup\n\nAdd `webhooks` to `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = (\n 'webhooks',\n ...\n)\n```\n\n## Settings\n\n- `WEBHOOK_TIMEOUT` - Seconds to wait until a request times out\n- `WEBHOOK_THREADS` - Maximum number of threads to be used in a worker pool\n- `WEBHOOK_USER_AGENT` - The user-agent string for POST requests. Defaults to the current site name if the Django sites apps is installed.\n- `WEBHOOK_VERSION` - The webhook version. If not None, this will be added to the user-agent string, e.g. 'Webhooks/1.0'. Default is 1.0.\n\n## Trigger Execution\n\n1. Events are triggered using `webhooks.trigger(event, [*args, [**kwargs]])`\n2. If a handler is registered for the event, the arguments are passed into the handler to generate a JSON-serializable payload.\n3. All URLs registered for this event are collected and each URL receives a POST request with the JSON payload\n\n**Notes:**\n\n- If no URLs are registered for the event, the payload is not generated (since it would be wasted computation)\n- All requests are sent in parallel using threads\n- Logging is heavily use to catch any undesirable or unexpected behaviors (such as failing requests, errors or data serialization)\n\n## Usage\n\n```python\nimport webhooks\n\n# Define and register a handler for an event\ndef handler():\n return { ... }\n\nwebhooks.events.register('event', handler)\n\n# Bind a URL to the event\nwebhooks.bind('event', 'http://example.com')\n\n# Trigger the event. Any arguments after the event name\n# will be passed into the handler to produce the data that\n# will be POSTed to the bound URLs.\nwebhooks.trigger('event')\n```\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cbmi/django-webhooks/", "keywords": "webhooks events callbacks", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-webhooks2", "package_url": "https://pypi.org/project/django-webhooks2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-webhooks2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/cbmi/django-webhooks/" }, "release_url": "https://pypi.org/project/django-webhooks2/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Simple webhooks for Django", "version": "0.1.0" }, "last_serial": 872785, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c2e0288059137d15a03840838d3900d7", "sha256": "6b10aa74740ebab7af8d20dc57757f15ce5bb9923dcc4a3696f38981371fe1dd" }, "downloads": -1, "filename": "django-webhooks2-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c2e0288059137d15a03840838d3900d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6143, "upload_time": "2013-09-24T13:55:34", "url": "https://files.pythonhosted.org/packages/79/b7/b85368ff416ad2509f38b6b5f9ecfca8b5a751bb6e4e450b679b8d77684a/django-webhooks2-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c2e0288059137d15a03840838d3900d7", "sha256": "6b10aa74740ebab7af8d20dc57757f15ce5bb9923dcc4a3696f38981371fe1dd" }, "downloads": -1, "filename": "django-webhooks2-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c2e0288059137d15a03840838d3900d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6143, "upload_time": "2013-09-24T13:55:34", "url": "https://files.pythonhosted.org/packages/79/b7/b85368ff416ad2509f38b6b5f9ecfca8b5a751bb6e4e450b679b8d77684a/django-webhooks2-0.1.0.tar.gz" } ] }