Skip to main content

Notification functionality to use within Django

Project description

# [Django Notification System][docs] [![pypi-version]][pypi]

Finally, an awesome Django Notification System.

Full documentation for the package is avalaible at https://django-notification-system.readthedocs.io/en/latest/

# Overview

Perhaps you’ve got a Django application that you’d like to send notifications from?

Well, we certainly have our share of them. And guess what? We’re tired of writing code to create and send various types of messages over and over again!

So, we’ve created this package to simplify things a bit for future projects. Hopefully, it will help you too.

Here’s the stuff you get:

  1. A few Django models that are pretty important:

  • Notification: A single notification. Flexible enough to handle many different types of notifications.

  • NotificationTarget: A target for notifications. Email, SMS, etc.

  • TargetUserRecord: Info about the user in a given target (Ex. Your “address” in the “email” target).

  • NotificationOptOut: Single location to keep track of user opt outs. You don’t want the spam police after you.

  1. Built in support for [email, Twilio SMS, and Expo push notifications][docs-util].

  2. Some cool management commands that:

  • Process all pending notifications.

  • Create UserInNotificationTarget objects for the email target for all the current users in your database. Just in case you are adding this to an older project.

  1. A straightforward and fairly easy way to for you to add support for addition notification types while tying into the existing functionality. No whining about it not being super easy! This is still a work in progress. :)

Brought to you by the cool kids (er, kids that wanted to be cool) in the Center for Research Computing at Notre Dame.

# Requirements

  • Python (3.5, 3.6, 3.7, 3.8)

  • Django (3.1+)

We highly recommend and only officially support the latest patch release of each Python and Django series.

# Installation

pip install django-notification-system

# Post-Install Setup (Optional)

If you would like to add support for addition types of notifications that don’t exist in the package yet, you’ll need to add the following items to your Django settings. We will cover these items in more detail in the [extending the system section of our docs][docs-ext]. So just a quick intro here.

Django Settings Additions
INSTALLED_APPS = [
    "django_notification_system",
    ...
]
# Add the following variables to your Django settings if
# you want to write modules to support additional notification
# types not included the library.

# A list of locations for the system to search for notification creators.
# You can just create the list and leave it empty if you want to just put this in place.
NOTIFICATION_SYSTEM_CREATORS = [
    '/path/to/creator_modules',
    '/another/path/to/creator_modules']

# A list of locations for the system to search for notification handlers.
# You can just create the list and leave it empty if you want to just put this in place.
NOTIFICATION_SYSTEM_HANDLERS = [
    '/path/to/handler_modules',
    '/another/path/to/handler_modules']

# Twilio Required settings, if you're not planning on using Twilio these can be set
# to empty strings
TWILIO_ACCOUNT_SID = 'FAKE_SID_FOR_DEMO_PURPOSES'
TWILIO_AUTH_TOKEN = 'FAKE_TOKEN_FOR_DEMO_PURPOSES'
TWILIO_SENDER = '+15555555555'

[pypi-version]: https://img.shields.io/pypi/v/django-notification-system.svg [pypi]: https://pypi.org/project/django-notification-system/1.0.0/ [docs]: https://django-notification-system.readthedocs.io/en/latest/ [docs-ext]: https://django-notification-system.readthedocs.io/en/latest/extending.html [docs-util]: https://django-notification-system.readthedocs.io/en/latest/utility_functions.html

Project details


Download files

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

Source Distribution

django-notification-system-1.1.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

django_notification_system-1.1.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file django-notification-system-1.1.0.tar.gz.

File metadata

  • Download URL: django-notification-system-1.1.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.4

File hashes

Hashes for django-notification-system-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ef053fe10180bf1eb7b4efd5a94213012d2a3774fe19173b33b47edd05e3683f
MD5 921c1c084c0a3c6ea89673c371962392
BLAKE2b-256 de8f38e2e9c0fac5b1b0200850b8923c29a17c3d7a44607a32b44628e487d585

See more details on using hashes here.

File details

Details for the file django_notification_system-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_notification_system-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.4

File hashes

Hashes for django_notification_system-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 524b29400a110020a975ed67c31ac07d66fe94d0709d6b2e238f0826666490e8
MD5 991a88f3c9acd63989b10dd7eb92b972
BLAKE2b-256 f9ce6a06e40e1e9a0ae3110a6abe96ec32d91ccd94218d2767aa4ae4904e2d5c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page