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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c179cd98a311faf0adfee48ce06f3ba923f8e923a2c7e58430625b04c8cca30 |
|
MD5 | 446568190ee7995f5a8904072d734766 |
|
BLAKE2b-256 | eedc31399ad44f62cbb630fa3ee9944602b0a1b814aff2e67ad0e42ea9b81571 |