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.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd6eb9911198dc91d0705d89a2b33b6496fa118335290d65f485f3c261acf1f6 |
|
MD5 | 8fbbde18a6322e826f535b4dfcfb5c4b |
|
BLAKE2b-256 | b783e5194f54707111fc8f9aa5124fab27f6f40688c1f505be394a0f6fd000ca |