Django notification app.
Project description
django-notifications
Quick start
-
Add "django_notifications" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'django_notifications', ]
-
Run
python manage.py migrate
to create the django_notifications models. -
Settings:
MAX_ATTEMPTS_NUMBER: [DEFAULT=3] How many times should we try to send a notification. If the number is reached, the notification will be removed.
-
Examples
a) Creating e-mail notification:
NotificationQueue.objects.create( custom_notification_id='USER1_LOGGED_IN_070920202201', backend='email', data={ 'subject': 'Login from a new device', 'body': '<h1>It looks like you’ve recently signed in.....</h1>', 'to': 'email@localhost' } ) ... from django_notifications.helpers import EmailNotificationQueueManagement EmailNotificationQueueManagement().send_notifications() # if the notification is not sent, it will go to the error queue from django_notifications.helpers import EmailNotificationErrorQueueManagement EmailNotificationErrorQueueManagement().send_notifications()
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
Close
Hashes for django-notifications2-0.1.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34698dbaf24ca9e429b0c645c0653ad696f9d485827d3f4ecad3d944d4c1de1d |
|
MD5 | e46846106385bb96332044246c72344e |
|
BLAKE2b-256 | 7bbd70e1a962dd496dec574ce012ad082faa4efb1e4fe16ad4d0a43787a540b8 |