{ "info": { "author": "Aaron Bassett, Pusher", "author_email": "aaron@rawtech.io, support@pusher.com", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "# django-pusherable\n\nReal-time object access notifications via [Pusher](https://pusher.com).\n\n## Installation\n\nInstall django-pusherable:\n\n```bash\npip install django-pusherable\n```\n\n## Configuration\n\nThen add `pusherable` to your `INSTALLED_APPS`. You will also need to add your Pusher\napp credentials to `settings.py`. These are available on your app keys page:\n\n```python\nPUSHER_APP_ID = u\"\"\nPUSHER_KEY = u\"\"\nPUSHER_SECRET = u\"\"\nPUSHER_CLUSTER = u\"\"\n```\n\n## Mixins\n\nTo begin receiving notifications about an object use the mixins:\n\n```python\nfrom pusherable.mixins import PusherDetailMixin, PusherUpdateMixin\n\nclass PostDetail(PusherDetailMixin, DetailView):\n model = Post\n\nclass PostUpdate(PusherUpdateMixin, UpdateView):\n model = Post\n form_class = PostUpdateForm\n```\n\nWhen the view is accessed it will send an event on the channel\n`modelname_pk` which contains a JSON representation of the object (model instance)\nbeing accessed as well as the user.\n\nThe data will be in the form:\n\n```json\n{\n \"object\": {\n \"question\": \"What's up?\",\n \"pub_date\": \"2013-08-08T11:16:24\",\n \"id\": 1\n },\n \"user\": \"admin\"\n}\n```\n\nWhich fields are included and excluded within the `object` is configurable via\n`pusher_include_model_fields` and `pusher_exclude_model_fields`. For example,\nthe following would exclude the `pub_date` from the event payload:\n\n```python\nclass PostUpdate(PusherUpdateMixin, UpdateView):\n model = Post\n form_class = PostUpdateForm\n pusher_exclude_model_fields = 'pub_date'\n```\n\n## Template tags\n\nTo subscribe to these events on your page you can use the templatetags:\n\n```\n{% load pusherable_tags %}\n\n{% pusherable_script %}\n```\n\nThe `pusherable_script` tag will include the Pusher library. Place this in the\nhead of your page:\n\n```\n{% pusherable_subscribe 'update' object %}\n```\n\nThe `pusherable_subscribe` tag will begin subscribe you to the channel for the\nobject. The first argument is the type of event you want to subscribe to.\nThe default events are `update` and `view`.\n\nWhen a new event is received it will pass event type and data to a Javascript\nfunction called `pusherable_notify`. Create this function and use it to alert your\nusers to the new event. For example:\n\n```html\n\n```\n\n## Running Tests\n\nPusherable comes with test requirements and a test runner:\n\n```bash\npip install -r requirements-test.txt\npython runtests.py\n```\n\n## Credits\n\ndjango-pusherable was built by [Aaron Bassett](https://twitter.com/aaronbassett) for Pusher.", "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/pusher/django-pusherable", "keywords": "django-pusherable", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-pusherable", "package_url": "https://pypi.org/project/django-pusherable/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-pusherable/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/pusher/django-pusherable" }, "release_url": "https://pypi.org/project/django-pusherable/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Real time object access notifications via Pusher", "version": "0.2.0" }, "last_serial": 2916502, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d0db0de48746263cb4f9c054b81339f6", "sha256": "b76cda454f213e933040be266fd18b727c4fdc6c4ac607cb68682fc2e1cf6bce" }, "downloads": -1, "filename": "django-pusherable-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d0db0de48746263cb4f9c054b81339f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6280, "upload_time": "2015-05-27T09:57:22", "url": "https://files.pythonhosted.org/packages/5e/75/ae56c87c0aee72f63d3910568e3a4a64be37d01f0c0f03dfcbf07525500e/django-pusherable-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "dacfcaec3dd9fe5977e5f42941169faa", "sha256": "dc7782b542eb59507eed17aa1fe0c1366924678705911b4a407bcf15b1dd8321" }, "downloads": -1, "filename": "django-pusherable-0.2.0.tar.gz", "has_sig": false, "md5_digest": "dacfcaec3dd9fe5977e5f42941169faa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4964, "upload_time": "2017-06-01T11:44:01", "url": "https://files.pythonhosted.org/packages/e2/50/db3169b7d8fc94338db228eb2c9e3da076f85db0fdf81b802088ca6543b6/django-pusherable-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dacfcaec3dd9fe5977e5f42941169faa", "sha256": "dc7782b542eb59507eed17aa1fe0c1366924678705911b4a407bcf15b1dd8321" }, "downloads": -1, "filename": "django-pusherable-0.2.0.tar.gz", "has_sig": false, "md5_digest": "dacfcaec3dd9fe5977e5f42941169faa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4964, "upload_time": "2017-06-01T11:44:01", "url": "https://files.pythonhosted.org/packages/e2/50/db3169b7d8fc94338db228eb2c9e3da076f85db0fdf81b802088ca6543b6/django-pusherable-0.2.0.tar.gz" } ] }