Manage programatic *Push Notifications* from Django admin
Project description
========
Djpush
========
Manage programatic *Push Notifications* from Django admin.
Features
========
- Define notifications via the admin
- Categorize notifications
- Schedule notifications by category
- Choose your provider(APNS/apns2, GCM/gcm, OneSignal/yaosac). Actually you must install one.
- Same notification in time range are canceled
- (optional) Multiple language support via django-modelstranslation
Important Dependencies
======================
- celery
- django-timezone-field
- pytz
Usage
=====
In your `settings.py` define:
DJPUSH_NOTIFICATIONS_CHOICES
A list of `slugs <https://docs.djangoproject.com/en/1.11/glossary/#term-slug>`_ representing the notifications you want to send.
DJPUSH_DEFAULT_PROVIDER
The provider you want to use to send notifications(values can be found in `pypn <https://github.com/alej0varas/pypn>`_).
optional settings
DJPUSH_NOTIFICATION_EXPIRES
The number of seconds after task will be considered expired
.. code-block:: python
# Get a notification, you define them in the admin
notification = models.Notification.objects.get(slug='a-slug', enabled=True)
# Create a notification instance
notification_instance = models.NotificationInstance.objects.create(notification=notification, tokens=tokens, data=data)
# Send the notification
notification_instance.send()
Development
===========
Update migrations
-----------------
::
DJANGO_SETTINGS_MODULE=migration_settings django-admin makemigrations
Run tests
---------
::
./runtests.py
Build/Publish
-------------
::
rm -rf dist
python setup.py sdist bdist_wheel
twine upload dist/*
Translations
------------
To enable translations you have to install `django-modeltranslation`
and add `MIGRATION_MODULES = {'djpush': 'djangoproject.migrations'}`
to your settings.
Notifications will be sent including the available tranlations.
Djpush
========
Manage programatic *Push Notifications* from Django admin.
Features
========
- Define notifications via the admin
- Categorize notifications
- Schedule notifications by category
- Choose your provider(APNS/apns2, GCM/gcm, OneSignal/yaosac). Actually you must install one.
- Same notification in time range are canceled
- (optional) Multiple language support via django-modelstranslation
Important Dependencies
======================
- celery
- django-timezone-field
- pytz
Usage
=====
In your `settings.py` define:
DJPUSH_NOTIFICATIONS_CHOICES
A list of `slugs <https://docs.djangoproject.com/en/1.11/glossary/#term-slug>`_ representing the notifications you want to send.
DJPUSH_DEFAULT_PROVIDER
The provider you want to use to send notifications(values can be found in `pypn <https://github.com/alej0varas/pypn>`_).
optional settings
DJPUSH_NOTIFICATION_EXPIRES
The number of seconds after task will be considered expired
.. code-block:: python
# Get a notification, you define them in the admin
notification = models.Notification.objects.get(slug='a-slug', enabled=True)
# Create a notification instance
notification_instance = models.NotificationInstance.objects.create(notification=notification, tokens=tokens, data=data)
# Send the notification
notification_instance.send()
Development
===========
Update migrations
-----------------
::
DJANGO_SETTINGS_MODULE=migration_settings django-admin makemigrations
Run tests
---------
::
./runtests.py
Build/Publish
-------------
::
rm -rf dist
python setup.py sdist bdist_wheel
twine upload dist/*
Translations
------------
To enable translations you have to install `django-modeltranslation`
and add `MIGRATION_MODULES = {'djpush': 'djangoproject.migrations'}`
to your settings.
Notifications will be sent including the available tranlations.
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
djpush-0.9.4.tar.gz
(12.0 kB
view details)
Built Distribution
djpush-0.9.4-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file djpush-0.9.4.tar.gz
.
File metadata
- Download URL: djpush-0.9.4.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fb0ad90241cef70186a5132d19c9ae8285c30df2e685a74baa9a33cc05ef4a9 |
|
MD5 | 4b4135a00e8ed7c84f30e8131b782c4d |
|
BLAKE2b-256 | bc9c154fc9005e1724b9f5c5ec3a910555e63039ac2ceefe33705dd5478d7245 |
File details
Details for the file djpush-0.9.4-py3-none-any.whl
.
File metadata
- Download URL: djpush-0.9.4-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afbfae8e206d89c5b807112644ac485fcdb468935f7cf5b26496eb44ccca6443 |
|
MD5 | 62d7d524d9ef3c5d52ea4095e8b088c0 |
|
BLAKE2b-256 | 9b6a22a9ab3699383ffdd90b9fe17b2b871ca66b0e7d59ac6087137d2349b71a |