{ "info": { "author": "Paul Oostenrijk", "author_email": "paul@glemma.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "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", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3" ], "description": "Django Push Notifications\n=========================\n.. image:: https://travis-ci.org/Fueled/django-push-notifications.svg\n :target: https://travis-ci.org/Fueled/django-push-notifications\n\nThis package makes it easy to support Push notifications. It works\ntogether with third party services such as ``ZeroPush``.\n\nYou can easily add permissions to push devices by chaining those devices\nto a notification setting. For registering a new push device you can add\ncustom permissions.\n\nInstallation\n------------\n\nTo install the package on your machine you can run the PIP install:\n\n::\n\n pip install django-pnm\n\nConfiguration\n-------------\n\nFirst you have to add ``push_notifications`` to your installed apps:\n\n.. code:: python\n\n INSTALLED_APPS = (\n ...\n 'push_notifications',\n )\n\nTo setup the package you have to add a ``DJANGO_PUSH_NOTIFICATIONS``\ninto your settings:\n\n.. code:: python\n\n def Settings(Configuration):\n # ...\n DJANGO_PUSH_NOTIFICATIONS = {\n 'SERVICE': 'push_notifications.services.zeropush.ZeroPushService',\n 'AUTH_TOKEN': '123123123'\n }\n\nThe ``SERVICE`` Key can be set to the type of service you use. In this\nexample we use the ``ZeroPushService``. With the ``ZeroPush`` Service we\nare required to add a ``AUTH_TOKEN`` to the ``Configuration``.\n\n\nDon't forget to run the migrations\n~~~~~~~~~~~~~~~\nThen run the migrations by running: ``python manage.py migrate``\n\n\n**Note**: Right now, only ``ZeroPush`` is available. More services will\nbe available soon.\n\nFor Django REST Framework users\n-------------\n\nThere are also 2 endpoints for you available. These can be used to register and unregister a push device. The endpoints are Auth protected with the default settings of your Django REST Framework set up.\n\nTo enable the ``unregister`` and ``register`` endpoints you can add the following to your ``urls.py`` file:\n\n.. code:: python\n url(r'^notifications/', include('push_notifications.urls')),\n\n\n**Note**: We purposely have chosen to not include ``djangorestframework`` as a dependecy. If you don't have it you would have to include it in your ``requirements.txt`` file.\n\nUsage\n-----\n\nRegister a device\n~~~~~~~~~~~~~~~~~\n\nTo register a new device you can use the ``register_push_device`` method\nin ``utils``:\n\n.. code:: python\n\n from push_notifications.utils from register_push_device\n\n token = \"\"\n register_push_device(user, token)\n\nYou can also pass notification permissions directly to the\n``register_push_device`` method:\n\n.. code:: python\n\n register_push_device(user, token, ['likes', 'comments'])\n\nAdd permissions\n~~~~~~~~~~~~~~~\n\nTo add an notification permission to a push device you can use the\n``add_permission`` method on the ``device`` object:\n\n.. code:: python\n\n device.add_permission('likes')\n\nOr adding multiple permissions\n\n.. code:: python\n\n device.add_permissions(['likes', 'comments'])\n\nAdd all the permission for the devices that the user owns.\n\n.. code:: python\n\n user.push_devices.add_permissions(['likes', 'comments'])\n\nRemove permissions\n~~~~~~~~~~~~~~~~~~\n\nTo remove a notification permission you can use ``remove_permission``\nmethod on the ``device`` object:\n\n.. code:: python\n\n device.remove_permissions('likes')\n\nOr removing multiple permissions\n\n.. code:: python\n\n device.remove_permissions(['likes', 'comments'])\n\nRemove all the permission for the devices that the user owns.\n\n.. code:: python\n\n user.push_devices.remove_permissions(['likes', 'comments'])\n\nSend a notification\n~~~~~~~~~~~~~~~~~~~\n\nTo send a notification to a certain permission group you can call\n``send_push_notification`` in ``utils``:\n\n.. code:: python\n\n from push_notifications import send_push_notification\n from datetime import timedelta\n\n send_push_notification('likes', 'This is the message', sound=\"annoyingSound.mp3\",\n badge_number=1\n info={\n \"extra\": \"payload\",\n \"in\": \"notification\"\n },\n expiry=timedelta(days=30))\n\nDescription\n^^^^^^^^^^^\n\n``send_push_notification(notify_type, message, **kwargs)``\n\n**kwargs** - ``sound``: The sound that has to be played when sending the\nnotification - ``badge_number``: The badge\\_number that has to be\ndisplayed **(iOS Only)** - ``info``: Extra payload that comes along the\nnotification - ``expiry``: The expiry of the notification **Accepts\ntimedelta and datetime object**\n\nSend a notification to one device\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo send a notification to a specific device you can use the\n``send_push_notification`` on the ``device`` object\n\n.. code:: python\n\n device.send_push_notification('likes', 'This is the message', sound=\"annoyingSound.mp3\",\n badge_number=1\n info={\n \"extra\": \"payload\",\n \"in\": \"notification\"\n },\n expiry=timedelta(days=30))\n\nIt accepts the same parameters as the global ``send_push_notification``\nin ``utils``.\n\nSend a notification to one user\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo send a notification to a user and all its devices you can use the\n``send_push_notification`` on the ``push_devices`` name in your user\nobject:\n\n.. code:: python\n\n user.push_devices.send_push_notification('likes', 'This is the message',\n sound=\"annoyingSound.mp3\",\n badge_number=1\n info={\n \"extra\": \"payload\",\n \"in\": \"notification\"\n },\n expiry=timedelta(days=30))", "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/Fueled/django-push-notifications", "keywords": "pnm,django,push,notifications,manager", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-pnm", "package_url": "https://pypi.org/project/django-pnm/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-pnm/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Fueled/django-push-notifications" }, "release_url": "https://pypi.org/project/django-pnm/0.1.6/", "requires_dist": null, "requires_python": null, "summary": "A plug and play package to handle push devices and push notifications for services such as ZeroPush and Urban Airship", "version": "0.1.6" }, "last_serial": 1621648, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8f095ff380aff173778166408b872028", "sha256": "192ddc03a57f37f1070ee41f00507f334315f57a66954f75852b7a3736186b28" }, "downloads": -1, "filename": "django-pnm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8f095ff380aff173778166408b872028", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7107, "upload_time": "2015-04-30T03:26:33", "url": "https://files.pythonhosted.org/packages/95/6f/668fe4d8d8a42d0e8201f5ab069ad7f8ce7a35d69503fb615fd7a4a7e24b/django-pnm-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "82c5ed87710e9af14518c5fdb51bb5ff", "sha256": "85f8865e936eed0731a9bb3765056230b2beef0b24814658853880572d890462" }, "downloads": -1, "filename": "django-pnm-0.1.1.tar.gz", "has_sig": false, "md5_digest": "82c5ed87710e9af14518c5fdb51bb5ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7142, "upload_time": "2015-05-05T13:54:08", "url": "https://files.pythonhosted.org/packages/44/88/64ca91341f4272658e6619ca94e99b74a6cb39c2f89bb0fe79274f25baf4/django-pnm-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "473cec00d22c523a2ad9b9cf7fe20557", "sha256": "c73120d892bafb291857d80b5031edbf3d2a5f57938eda2d330694bbcc9dfff9" }, "downloads": -1, "filename": "django-pnm-0.1.2.tar.gz", "has_sig": false, "md5_digest": "473cec00d22c523a2ad9b9cf7fe20557", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7141, "upload_time": "2015-05-13T19:00:26", "url": "https://files.pythonhosted.org/packages/2c/39/77ca7ebc9a89d217645d38efeabcc7b716f0a146044054e325b1a0564c5f/django-pnm-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d553cb769d6be277dccc6fbec3e24ae8", "sha256": "9d35466c605eb37140cca9cb19a930371beb3c888de7eac26915a575714440e7" }, "downloads": -1, "filename": "django-pnm-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d553cb769d6be277dccc6fbec3e24ae8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7148, "upload_time": "2015-05-13T20:36:34", "url": "https://files.pythonhosted.org/packages/52/34/b1d79ac4393c85e90864e2798ca766add0e274e01ff9bbc3c3da72156203/django-pnm-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "74e5edfbd15fab433c439b7b111bc2e6", "sha256": "e7d0c3173af123d553ff6ebbcde4023e1a321d1ce367aff64b946601904cd26b" }, "downloads": -1, "filename": "django-pnm-0.1.4.tar.gz", "has_sig": false, "md5_digest": "74e5edfbd15fab433c439b7b111bc2e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8664, "upload_time": "2015-06-09T19:30:31", "url": "https://files.pythonhosted.org/packages/4d/a8/e8cdb19ae2dd6633c11051420b5d1f1bd66748c70e1d89daa252ea9336f0/django-pnm-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5ea866d5910f73e5576919a296c1f545", "sha256": "d716cfa7583149601dca31d2defaf4d4100dd0c1de8c74dc3d44c765ae312f45" }, "downloads": -1, "filename": "django-pnm-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5ea866d5910f73e5576919a296c1f545", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8753, "upload_time": "2015-06-17T19:20:35", "url": "https://files.pythonhosted.org/packages/f4/2e/e2b9d690d2ce881402790f5740488a2a3c61f05d3a8c9c29647155f9f91f/django-pnm-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "a88740338879be4fdca70a758701450f", "sha256": "ca13e5cd126d925b3213512aeb1b935362b3a62758dbdf1b36cc80790536a291" }, "downloads": -1, "filename": "django-pnm-0.1.6.tar.gz", "has_sig": false, "md5_digest": "a88740338879be4fdca70a758701450f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8915, "upload_time": "2015-07-06T20:42:47", "url": "https://files.pythonhosted.org/packages/d5/6f/145f21065b7583118f890e1d2bac41b1d66651f1fac3c203f9479309a2fa/django-pnm-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a88740338879be4fdca70a758701450f", "sha256": "ca13e5cd126d925b3213512aeb1b935362b3a62758dbdf1b36cc80790536a291" }, "downloads": -1, "filename": "django-pnm-0.1.6.tar.gz", "has_sig": false, "md5_digest": "a88740338879be4fdca70a758701450f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8915, "upload_time": "2015-07-06T20:42:47", "url": "https://files.pythonhosted.org/packages/d5/6f/145f21065b7583118f890e1d2bac41b1d66651f1fac3c203f9479309a2fa/django-pnm-0.1.6.tar.gz" } ] }