Skip to main content

Django notification app.

Project description

django-notifications

Quick start

  1. Add "django_notifications" to your INSTALLED_APPS setting like this:

        INSTALLED_APPS = [
            ...
            'django_notifications',
        ]
    
  2. Run python manage.py migrate to create the django_notifications models.

  3. 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.
    
  4. 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


Download files

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

Source Distribution

django-notifications2-0.1.11.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file django-notifications2-0.1.11.tar.gz.

File metadata

  • Download URL: django-notifications2-0.1.11.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for django-notifications2-0.1.11.tar.gz
Algorithm Hash digest
SHA256 34698dbaf24ca9e429b0c645c0653ad696f9d485827d3f4ecad3d944d4c1de1d
MD5 e46846106385bb96332044246c72344e
BLAKE2b-256 7bbd70e1a962dd496dec574ce012ad082faa4efb1e4fe16ad4d0a43787a540b8

See more details on using hashes here.

Supported by

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