{ "info": { "author": "Daniel Greenfeld", "author_email": "pydanny@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "=============================\ndj-webhooks\n=============================\n\n.. image:: https://pypip.in/d/dj-webhooks/badge.png\n :target: https://pypi.python.org/pypi/dj-webhooks\n\n.. image:: https://badge.fury.io/py/dj-webhooks.png\n :target: https://badge.fury.io/py/dj-webhooks\n\n.. image:: https://pypip.in/wheel/dj-webhooks/badge.png\n :target: https://pypi.python.org/pypi/dj-webhooks/\n :alt: Wheel Status\n\n.. image:: https://travis-ci.org/pydanny/dj-webhooks.png?branch=master\n :target: https://travis-ci.org/pydanny/dj-webhooks\n\nDjango + Webhooks Made Easy\n\nThe full documentation is at https://dj-webhooks.readthedocs.org.\n\nRequirements\n------------\n\n* Python 2.7.x or 3.3.2 or higher\n* django>=1.5.5\n* django-jsonfield>=0.9.12\n* django-model-utils>=2.0.2\n* django-rq>=0.6.1\n* webhooks>=0.3.1\n\nQuickstart\n----------\n\nInstall dj-webhooks::\n\n pip install dj-webhooks\n\nConfigure some webhook events:\n\n.. code-block:: python\n\n # settings.py\n WEBHOOK_EVENTS = (\n \"purchase.paid\",\n \"purchase.refunded\",\n \"purchase.fulfilled\"\n )\n\nAdd some webhook targets:\n\n.. code-block:: python\n\n from django.contrib.auth import get_user_model\n User = get_user_model()\n user = User.objects.get(username=\"pydanny\")\n\n from webhooks.models import Webhook\n WebhookTarget.objects.create(\n owner=user,\n event=\"purchase.paid\",\n target_url=\"https://mystorefront.com/webhooks/\",\n header_content_type=Webhook.CONTENT_TYPE_JSON,\n )\n\nThen use it in a project:\n\n.. code-block:: python\n\n from django.contrib.auth import get_user_model\n User = get_user_model()\n user = User.objects.get(username=\"pydanny\")\n\n from djwebhooks.decorators import hook\n\n from myproject.models import Purchase\n\n # Event argument helps identify the webhook target\n @hook(event=\"purchase.paid\")\n def send_purchase_confirmation(purchase, owner): # Webhook_owner also helps identify the webhook target\n return {\n \"order_num\": purchase.order_num,\n \"date\": purchase.confirm_date,\n \"line_items\": [x.sku for x in purchase.lineitem_set.filter(inventory__gt=0)]\n }\n\n for purchase in Purchase.objects.filter(status=\"paid\"):\n send_purchase_confirmation(purchase=purchase, owner=user)\n\nIn a queue using django-rq\n----------------------------\n\nAssuming you are running Redis and also have django-rq configured:\n\n.. code-block:: python\n\n from django.contrib.auth import get_user_model\n User = get_user_model()\n user = User.objects.get(username=\"pydanny\")\n\n # import redis hook\n from djwebhooks.decorators import redis_hook\n\n from myproject.models import Purchase\n\n # Event argument helps identify the webhook target\n @redis_hook(event=\"purchase.paid\")\n def send_purchase_confirmation(purchase, owner): # Webhook_owner also helps identify the webhook target\n return {\n \"order_num\": purchase.order_num,\n \"date\": purchase.confirm_date,\n \"line_items\": [x.sku for x in purchase.lineitem_set.filter(inventory__gt=0)]\n }\n\n for purchase in Purchase.objects.filter(status=\"paid\"):\n job = send_purchase_confirmation(purchase=purchase, owner=user)\n\n\nFeatures\n--------\n\n* Synchronous webhooks\n* Delivery tracking via Django ORM.\n* Options for asynchronous webhooks.\n\nPlanned Features\n-----------------\n\n* Delivery tracking via Redis and other write-fast datastores.\n\n\n\n\nHistory\n-------\n\n0.2.1 (2014-05-17)\n++++++++++++++++++\n\n* Removed conf.py file as it just added abstraction\n* Created exlicitly importable hooks. Makes settings management easier.\n* Removed utils.py since we no longer do fancy dynamic imports (see previous bullet).\n* Coverage now at 100%\n\n\n0.2.0 (2014-05-15)\n++++++++++++++++++\n\n* Refactored the senders to be very extendable.\n* Added an ORM based sender.\n* Added a redis based sender that uses django-rq.\n* Added a `redis-hook` decorator.\n* Added admin views.\n* Ramped up test coverage to 89%.\n* setup.py now includes all dependencies.\n\n\n0.1.0 (2014-05-12)\n++++++++++++++++++\n\n* First release on PyPI.", "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/pydanny/dj-webhooks", "keywords": "dj-webhooks", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "dj-webhooks", "package_url": "https://pypi.org/project/dj-webhooks/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dj-webhooks/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/pydanny/dj-webhooks" }, "release_url": "https://pypi.org/project/dj-webhooks/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Django + Webhooks Made Easy", "version": "0.2.1" }, "last_serial": 1095732, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d3bdccc0ad144220e8bef779cff00d06", "sha256": "2bf891e41e7553c3e199fed6a89c09ee48afa3853b7d3f654c898aeb7476f24f" }, "downloads": -1, "filename": "dj_webhooks-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d3bdccc0ad144220e8bef779cff00d06", "packagetype": "bdist_wheel", "python_version": "3.3", "requires_python": null, "size": 10708, "upload_time": "2014-05-14T05:52:12", "url": "https://files.pythonhosted.org/packages/bf/c0/5936eb8f79c36bc2d2394ddd916b4090bb73dbd9ea2411ec0870ce283fd4/dj_webhooks-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11a40ea2518d6c2ef32e6862a4e59e33", "sha256": "df2afb3e92767ca9d8be3c21563e18bbf126cff57dfe0005bc864ab45e08e458" }, "downloads": -1, "filename": "dj-webhooks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "11a40ea2518d6c2ef32e6862a4e59e33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9926, "upload_time": "2014-05-14T05:52:08", "url": "https://files.pythonhosted.org/packages/a9/be/8a791c660b4ff9ab0a74ad87f01c43666eea462631ed5f644d2f33bb0741/dj-webhooks-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7bbae87e46e8392575a3a6c434b7ab7d", "sha256": "f137d4a2f1461b2a2a856e021bd5783eccdf67f9cc53b550ac4e74b8451fcfdd" }, "downloads": -1, "filename": "dj_webhooks-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7bbae87e46e8392575a3a6c434b7ab7d", "packagetype": "bdist_wheel", "python_version": "3.3", "requires_python": null, "size": 12128, "upload_time": "2014-05-15T20:08:04", "url": "https://files.pythonhosted.org/packages/96/c6/6839326d1faa38d90b3a67ec5cbc0b70279f00298e78ec7431460c0fefda/dj_webhooks-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e7ce512e1825a3b42fe78e5a8f38c66", "sha256": "f3d660b7872354c0a7081ac04139f317cbaf4a4b6273df98dfa00382238023a8" }, "downloads": -1, "filename": "dj-webhooks-0.2.0.tar.gz", "has_sig": false, "md5_digest": "8e7ce512e1825a3b42fe78e5a8f38c66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10729, "upload_time": "2014-05-15T20:08:03", "url": "https://files.pythonhosted.org/packages/27/03/939294f917bc2100fd248a0fae28201f460590ea14ad59ea3fee7d927168/dj-webhooks-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "fefb968aa6195add3247359a6562a3eb", "sha256": "95d3c987e3a1655c402d55e1f3627a3d63eaa67e949b71699e253c9be364a27b" }, "downloads": -1, "filename": "dj_webhooks-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fefb968aa6195add3247359a6562a3eb", "packagetype": "bdist_wheel", "python_version": "3.3", "requires_python": null, "size": 12884, "upload_time": "2014-05-17T20:12:38", "url": "https://files.pythonhosted.org/packages/3b/00/168e6e6eec2cd5be07af9bcc8cb07ad55e47a787b6a59ef89c212e372ee6/dj_webhooks-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87f8ac81725090dbdf61cae40965328b", "sha256": "1e345baa6c03563c41d391206fd5461a346706610e6fa9fbb3fb7d981b8e31e8" }, "downloads": -1, "filename": "dj-webhooks-0.2.1.tar.gz", "has_sig": false, "md5_digest": "87f8ac81725090dbdf61cae40965328b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10531, "upload_time": "2014-05-17T20:12:35", "url": "https://files.pythonhosted.org/packages/fa/8b/355c730b6f4e0ebd48ed51a52e5ed2dc8e80be5b09465d369062e5eeab4f/dj-webhooks-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fefb968aa6195add3247359a6562a3eb", "sha256": "95d3c987e3a1655c402d55e1f3627a3d63eaa67e949b71699e253c9be364a27b" }, "downloads": -1, "filename": "dj_webhooks-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fefb968aa6195add3247359a6562a3eb", "packagetype": "bdist_wheel", "python_version": "3.3", "requires_python": null, "size": 12884, "upload_time": "2014-05-17T20:12:38", "url": "https://files.pythonhosted.org/packages/3b/00/168e6e6eec2cd5be07af9bcc8cb07ad55e47a787b6a59ef89c212e372ee6/dj_webhooks-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "87f8ac81725090dbdf61cae40965328b", "sha256": "1e345baa6c03563c41d391206fd5461a346706610e6fa9fbb3fb7d981b8e31e8" }, "downloads": -1, "filename": "dj-webhooks-0.2.1.tar.gz", "has_sig": false, "md5_digest": "87f8ac81725090dbdf61cae40965328b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10531, "upload_time": "2014-05-17T20:12:35", "url": "https://files.pythonhosted.org/packages/fa/8b/355c730b6f4e0ebd48ed51a52e5ed2dc8e80be5b09465d369062e5eeab4f/dj-webhooks-0.2.1.tar.gz" } ] }