{ "info": { "author": "Rieljun Liguid", "author_email": "me@iamriel.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "DRF Channels\n------------\n\n.. image:: https://travis-ci.org/iamriel/drf-channels.svg?branch=master\n :target: https://travis-ci.org/iamriel/drf-channels\n\nDRF Channels provides a simple django-channels bindings and consumer\nmixin that can be used to automatically listen and send to groups\neverytime a Resource is created/updated/deleted.\n\nIt requires Python >= 3.5, Channels >= 2.0, Django >=1.11, and Django Rest Framework 3.x\n\nThis is like a port of Channels 1.x's `Data_Binding `__\nand `Channels API `__\nwith few differences.\n\nThe data sent to the clients are based on the Serializer class\nprovided.\n\n\nHow does it work?\n-----------------\n\nThe API exposes a ``ResourceBinding`` class that holds your Model, Serializer class, and Consumer class.\nYour Consumer class needs to be a subclass of ``AsyncJsonWebsocketConsumer`` from channels and\nhave a ``AsyncConsumerActionMixin`` mixin.\n\nThe ``ResourceBinding`` class binds ``pre_save``, ``pre_delete``, ``post_save``, and ``post_delete`` signals\nto your model. These signals will then send to the corresponding Consumer groups that listens to your stream.\n\nThe first thing you need to do is connect to your consumer and pass the actions you want to subscribe to\nvia url parameters.\n\nFor example, you want to subscribe to the create and update actions ``Job`` Resource (Model),\nand the channels route is `/jobs/`, You will connect to the websocket like below,\nif you are using `Channels Websocket Wrapper `__:\n\n.. code:: javascript\n\n const webSocketBridge = new channels.WebSocketBridge()\n webSocketBridge.connect('/jobs/?subscribe=create,update')\n\n\nYou then need to add a listener on your webSocketBridge to receive the messages sent by the Consumer\nvia signals.\n\n.. code:: javascript\n\n webSocketBridge.socket.addEventListener('message', function(event) {\n\n })\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/iamriel/drf-channels", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "drf-channels", "package_url": "https://pypi.org/project/drf-channels/", "platform": "", "project_url": "https://pypi.org/project/drf-channels/", "project_urls": { "Homepage": "https://github.com/iamriel/drf-channels" }, "release_url": "https://pypi.org/project/drf-channels/0.1.1/", "requires_dist": [ "Django (>=1.11)", "channels (>=2.0)", "djangorestframework (>=3.0)" ], "requires_python": "", "summary": "Simple Resource binding and Consumer Mixin for Django Rest Framework and Channels 2", "version": "0.1.1" }, "last_serial": 3913353, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "6ea4853251f3b6b8b1097f424b009297", "sha256": "fec115ee4a0d8cbbe0aa36569399ac69ca0ba7c03ba9e4c25cb622494a6da4f8" }, "downloads": -1, "filename": "drf_channels-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6ea4853251f3b6b8b1097f424b009297", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9506, "upload_time": "2018-05-30T15:10:54", "url": "https://files.pythonhosted.org/packages/e1/a2/e6df6c789e2382fc54ea2e630fb385f2592e413d5c8650ca07e0b84cb65a/drf_channels-0.1-py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "31c941c3d40ccec1a16f07d6ba06bdd6", "sha256": "35311a7ccf01f9e4b3f2a84a5a7809e051424c65d2441978e7cdd3341b677830" }, "downloads": -1, "filename": "drf_channels-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "31c941c3d40ccec1a16f07d6ba06bdd6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9525, "upload_time": "2018-05-30T15:22:47", "url": "https://files.pythonhosted.org/packages/10/c9/e69ca9d4597def1c85b4297cab252b5a0596354d31d1deacfe1b09874420/drf_channels-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ac4f7716d8a772963826640f841a72b", "sha256": "f9a1d30a1ab998c45d2400300c93fe2ea3d474459305516f6a797003671f8e21" }, "downloads": -1, "filename": "drf_channels-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8ac4f7716d8a772963826640f841a72b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7225, "upload_time": "2018-05-30T15:22:48", "url": "https://files.pythonhosted.org/packages/8d/db/72c482f202590d2abd55c041818af247cedce44e436ff01e79b123ac1f3f/drf_channels-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "31c941c3d40ccec1a16f07d6ba06bdd6", "sha256": "35311a7ccf01f9e4b3f2a84a5a7809e051424c65d2441978e7cdd3341b677830" }, "downloads": -1, "filename": "drf_channels-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "31c941c3d40ccec1a16f07d6ba06bdd6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9525, "upload_time": "2018-05-30T15:22:47", "url": "https://files.pythonhosted.org/packages/10/c9/e69ca9d4597def1c85b4297cab252b5a0596354d31d1deacfe1b09874420/drf_channels-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ac4f7716d8a772963826640f841a72b", "sha256": "f9a1d30a1ab998c45d2400300c93fe2ea3d474459305516f6a797003671f8e21" }, "downloads": -1, "filename": "drf_channels-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8ac4f7716d8a772963826640f841a72b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7225, "upload_time": "2018-05-30T15:22:48", "url": "https://files.pythonhosted.org/packages/8d/db/72c482f202590d2abd55c041818af247cedce44e436ff01e79b123ac1f3f/drf_channels-0.1.1.tar.gz" } ] }