Support for Safari Push Notifications from within Django
Project description
Support for Safari Push Notifications from within Django
Documentation
The full documentation is at https://django-safari-notifications.readthedocs.io.
For the Safari Push documentations, refer to Apple Safari Push.
Quickstart
Install django_safari_notifications:
pip install django-safari-notifications
If you already have a valid “pushPackage.zip”, please serve it directly via your web server (Nginx/Apache) at the corresponding url: “{webServiceUrl}/{version}/pushPackages/{websitePushID}” (refer to Apple Safari Push)
Else, you must subclass django_safari_notifications.apps.DjangoSafariNotificationsConfig and set the cert and passphrase values.
from django_safari_notifications.apps import DjangoSafariNotificationsConfig
class MySafariNotificationsConfig(DjangoSafariNotificationsConfig):
cert = '/path/to/cert.pem'
passphrase = 'passphrase for key'
then add your config to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'my_safari_app.apps.MySafariNotificationsConfig', # if you need the pushPackage to be dynamically built
## OR ##
'django_safari_notifications.apps.DjangoSafariNotificationsConfig', # If you are serving your own push package via Nginx
...
)
Add django_safari_notifications’s URL patterns:
from django_safari_notifications import urls as django_safari_notifications_urls
urlpatterns = [
...
url(r'^', include(django_safari_notifications_urls, namespace='safari_pn')),
...
]
Do not use any prefix for the unless you are serving your own pushPackage.zip statically
Features
TODO
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Tools used in rendering this package:
History
0.1.0 (2016-12-10)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-safari-notifications-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f6bf52d979104a11ddca0d33393c9154235fadbf1d7ef67deb6d2bd9f21e89 |
|
MD5 | b5782ad48a5118ba10f91800b3406830 |
|
BLAKE2b-256 | ac0dadd4fda9206382f1f0c073dd5282282a85990c6f0c4cf3090abfaacb833e |
Hashes for django_safari_notifications-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e48f994abe563aaad97c7bb234bde0ec88b20944b1a3eb1585dfd65170d55305 |
|
MD5 | 675ad0015203f5a78d787ff3253682ac |
|
BLAKE2b-256 | 5de8df4b7f04b9a3848cc926cb51b383161bb7c545d4c3953e865f2809e23085 |