{ "info": { "author": "Jerome Leclanche", "author_email": "jerome@leclan.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Networking" ], "description": "django-pushapp\n=========================\n\n.. image:: https://api.travis-ci.org/jleclanche/django-pushapp.png\n\t:target: https://travis-ci.org/jleclanche/django-pushapp\n\nA minimal Django app that implements Device models that can send messages through APNS and GCM.\n\nThe app implements two models: GCMDevice and APNSDevice. Those models share the same attributes:\n - name (optional): A name for the device.\n - is_active (default True): A boolean that determines whether the device will be sent notifications.\n - user (optional): A foreign key to auth.User, if you wish to link the device to a specific user.\n - device_id (optional): A UUID for the device obtained from Android/iOS APIs, if you wish to uniquely identify it.\n - registration_id (required): The GCM registration id or the APNS token for the device.\n\n\nThe app also implements an admin panel, through which you can test single and bulk notifications. Select one or more\nGCM or APNS devices and in the action dropdown, select \"Send test message\" or \"Send test message in bulk\", accordingly.\nNote that sending a non-bulk test message to more than one device will just iterate over the devices and send multiple\nsingle messages.\n\n\nDependencies\n------------\nDjango 1.8 is required. Support for older versions is available in the release 1.2.1.\n\nTastypie support should work on Tastypie 0.11.0 and newer.\n\n\nSetup\n-----\nYou can install the library directly from pypi using pip::\n\n\t$ pip install django-pushapp\n\n\nEdit your settings.py file::\n\n\tINSTALLED_APPS = (\n\t\t...\n\t\t\"pushapp\"\n\t)\n\n\tPUSHAPP_SETTINGS = {\n\t\t\"GCM_API_KEY\": \"\",\n\t\t\"APNS_CERTIFICATE\": \"/path/to/your/certificate.pem\",\n\t}\n\nNote: If you are planning on running your project with `DEBUG=True`, then make sure you have set the\n*development* certificate as your `APNS_CERTIFICATE`. Otherwise the app will not be able to connect to the correct host.\n\nYou can learn more about APNS certificates here: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ProvisioningDevelopment.html\n\nNative Django migrations are in use. `manage.py migrate` will install and migrate all models.\n\n\nSettings list\n-------------\nAll settings are contained in a PUSHAPP_SETTINGS dict.\n\nIn order to use GCM, you are required to include GCM_API_KEY.\nFor APNS, you are required to include APNS_CERTIFICATE.\n\n- APNS_CERTIFICATE: Absolute path to your APNS certificate file. Certificates with passphrases are not supported.\n- GCM_API_KEY: Your API key for GCM.\n- APNS_HOST: The hostname used for the APNS sockets. When DEBUG=True, this defaults to gateway.sandbox.push.apple.com. When DEBUG=False, this defaults to gateway.push.apple.com.\n- APNS_PORT: The port used along with APNS_HOST. Defaults to 2195.\n- GCM_POST_URL: The full url that GCM notifications will be POSTed to. Defaults to https://android.googleapis.com/gcm/send.\n- GCM_MAX_RECIPIENTS: The maximum amount of recipients that can be contained per bulk message. If the registration_ids list is larger than that number, multiple bulk messages will be sent. Defaults to 1000 (the maximum amount supported by GCM).\n\nSending messages\n----------------\nGCM and APNS services have slightly different semantics. The app tries to offer a common interface for both when using the models.\n\n::\n\n\tfrom pushapp.models import APNSDevice, GCMDevice\n\n\tdevice = GCMDevice.objects.get(registration_id=gcm_reg_id)\n\t# The first argument will be sent as \"message\" to the intent extras Bundle\n\t# Retrieve it with intent.getExtras().getString(\"message\")\n\tdevice.send_message(\"You've got mail\")\n\t# If you want to customize, send an extra dict and a None message.\n\t# the extras dict will be mapped into the intent extras Bundle.\n\t# For dicts where all values are keys this will be sent as url parameters,\n\t# but for more complex nested collections the extras dict will be sent via\n\t# the bulk message api.\n\tdevice.send_message(None, extra={\"foo\": \"bar\"})\n\n\tdevice = APNSDevice.objects.get(registration_id=apns_token)\n\tdevice.send_message(\"You've got mail\") # Alert message may only be sent as text.\n\tdevice.send_message(None, badge=5) # No alerts but with badge.\n\tdevice.send_message(None, badge=1, extra={\"foo\": \"bar\"}) # Silent message with badge and added custom data.\n\nNote that APNS does not support sending payloads that exceed 2048 bytes (increased from 256 in 2014).\nThe message is only one part of the payload, if\nonce constructed the payload exceeds the maximum size, an APNSDataOverflow exception will be raised before anything is sent.\n\n\nSending messages in bulk\n------------------------\n::\n\n\tfrom pushapp.models import APNSDevice, GCMDevice\n\n\tdevices = GCMDevice.objects.filter(user__first_name=\"James\")\n\tdevices.send_message(\"Happy name day!\")\n\nSending messages in bulk makes use of the bulk mechanics offered by GCM and APNS. It is almost always preferable to send\nbulk notifications instead of single ones.\n\nAdministration\n--------------\nAPNS devices which are not receiving push notifications can be set to inactive by two methods. The web admin interface for\nAPNS devices has a \"prune devices\" option. Any selected devices which are not receiving notifications will be set to inactive(*).\nThere is also a management command to prune all devices failing to receive notifications::\n\n\tpython manage.py prune_devices\n\nThis removes all devices which are not receiving notifications.\n\nFor more information, please refer to the APNS feedback service_.\n\n.. _service: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html\n\n(*)Any devices which are not selected, but are not receiving notifications will not be deactivated on a subsequent call to \"prune devices\" unless another\nattempt to send a message to the device fails after the call to the feedback service.\n\nExceptions\n----------\n\n- NotificationError(Exception): Base exception for all notification-related errors.\n- gcm.GCMError(NotificationError): An error was returned by GCM. This is never raised when using bulk notifications.\n- apns.APNSError(NotificationError): Something went wrong upon sending APNS notifications.\n- apns.APNSDataOverflow(APNSError): The APNS payload exceeds its maximum size and cannot be sent.\n\n\nTastypie support\n----------------\n\nThe app includes tastypie-compatible resources in pushapp.api. These can be used as-is, or as base classes\nfor more involved APIs.\nThe following resources are available:\n\n- APNSDeviceResource\n- GCMDeviceResource\n- APNSDeviceAuthenticatedResource\n- GCMDeviceAuthenticatedResource\n\nThe base device resources will not ask for authentication, while the authenticated ones will link the logged in user to\nthe device they register.\nSubclassing the authenticated resources in order to add a SameUserAuthentication and a user ForeignKey is recommended.\n\nWhen registered, the APIs will show up at /device/apns and /device/gcm, respectively.\n\n\nPython 3 support\n----------------\n\ndjango-pushapp is fully compatible with Python 3.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/pirsipy/django-pushapp/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pirsipy/django-pushapp", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-pushapp", "package_url": "https://pypi.org/project/django-pushapp/", "platform": "", "project_url": "https://pypi.org/project/django-pushapp/", "project_urls": { "Download": "https://github.com/pirsipy/django-pushapp/tarball/master", "Homepage": "https://github.com/pirsipy/django-pushapp" }, "release_url": "https://pypi.org/project/django-pushapp/1.0.6/", "requires_dist": null, "requires_python": "", "summary": "Send push notifications to mobile devices through GCM or APNS in Django.", "version": "1.0.6" }, "last_serial": 3638314, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "fc9ae442a2eae1391b2f64497a3f1db4", "sha256": "f435d91fa8708afd8450d8cd6b8242a4967ae0768eb4d93e5dfdf4f4cbae9d14" }, "downloads": -1, "filename": "django-pushapp-1.0.0.tar.gz", "has_sig": false, "md5_digest": "fc9ae442a2eae1391b2f64497a3f1db4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14545, "upload_time": "2015-05-12T14:56:42", "url": "https://files.pythonhosted.org/packages/65/06/4bdf1454b3767eabde12717aa47629f0e35a065175dcd760e33b6bf70d5c/django-pushapp-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "291266cecd0abd27d3aaaf54f015b885", "sha256": "2c23da37d59562d602af7e35e85e313ca5f0ff55df687eea4d4a703ce6d3d0d6" }, "downloads": -1, "filename": "django-pushapp-1.0.1.tar.gz", "has_sig": false, "md5_digest": "291266cecd0abd27d3aaaf54f015b885", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14686, "upload_time": "2015-05-19T21:54:56", "url": "https://files.pythonhosted.org/packages/68/c3/9a4ec9800f286cf43b3534e5d2c8729f79e8f8bd0e1a1b9042a91a05c5b3/django-pushapp-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "890a82afe1340fe60b284cd9c7e45c56", "sha256": "2340ec229d9f53b4572af8d59b3ed6e524c9446a47289a98e87b149c238c15df" }, "downloads": -1, "filename": "django-pushapp-1.0.2.tar.gz", "has_sig": false, "md5_digest": "890a82afe1340fe60b284cd9c7e45c56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14582, "upload_time": "2018-03-04T15:26:58", "url": "https://files.pythonhosted.org/packages/bc/df/d7c00620f1b6a84bb975dee473154949d9e6e9d7ccef82d7a07526464f89/django-pushapp-1.0.2.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "db246e7a2e3c9d740235a31247bbdc25", "sha256": "4f85eee095496fd766b063451a468fda7a77731d86325f7bdfb1199d8ef43325" }, "downloads": -1, "filename": "django-pushapp-1.0.4.tar.gz", "has_sig": false, "md5_digest": "db246e7a2e3c9d740235a31247bbdc25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14623, "upload_time": "2018-03-04T15:47:11", "url": "https://files.pythonhosted.org/packages/b4/9f/ebba91141046777292de19c924fd6c1bbb18d6ef3f684450e329149b62b4/django-pushapp-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "515fadad061970c466fb90c109140bb5", "sha256": "2646e650f61a3e5648da38ba27edd57e86f6a867a21c66c842f4ef4457c1edf0" }, "downloads": -1, "filename": "django-pushapp-1.0.5.tar.gz", "has_sig": false, "md5_digest": "515fadad061970c466fb90c109140bb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14690, "upload_time": "2018-03-04T15:50:10", "url": "https://files.pythonhosted.org/packages/36/42/993ce9fe340b2ecdacb7d8b98cb3aa36ac120bef112fca6964f1920eb412/django-pushapp-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "b08bd0c0678b760d3589233b8f92fa1c", "sha256": "bbd559dbf3ff3ba0f7c1e07e55ad1ff48b1fe75eedff6d1d76a2c1ec44b07eee" }, "downloads": -1, "filename": "django-pushapp-1.0.6.tar.gz", "has_sig": false, "md5_digest": "b08bd0c0678b760d3589233b8f92fa1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14687, "upload_time": "2018-03-04T15:55:37", "url": "https://files.pythonhosted.org/packages/cc/f0/2fb9e934dc54876b0f544421a14932e6c9bf8300bee49467e53fd2e05e34/django-pushapp-1.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b08bd0c0678b760d3589233b8f92fa1c", "sha256": "bbd559dbf3ff3ba0f7c1e07e55ad1ff48b1fe75eedff6d1d76a2c1ec44b07eee" }, "downloads": -1, "filename": "django-pushapp-1.0.6.tar.gz", "has_sig": false, "md5_digest": "b08bd0c0678b760d3589233b8f92fa1c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14687, "upload_time": "2018-03-04T15:55:37", "url": "https://files.pythonhosted.org/packages/cc/f0/2fb9e934dc54876b0f544421a14932e6c9bf8300bee49467e53fd2e05e34/django-pushapp-1.0.6.tar.gz" } ] }