Skip to main content

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
======================

- 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for djpush, version 0.9.91
Filename, size File type Python version Upload date Hashes
Filename, size djpush-0.9.91-py3-none-any.whl (15.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size djpush-0.9.91.tar.gz (11.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page