Skip to main content

A Django app to handle notifications.

Project description

Django Dans Notifications

Lint Test Python codecov

Description

A Django app to handle notifications.

Support for basic notifications, push notifications and email notifications.

Quick start

  1. Add "django_dans_notifications" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
	...
	'django_dans_notifications',
]
  1. Include the notifications URLconf in your project urls.py like this:
path("notifications/", include("notifications.urls")),
  1. Run python manage.py migrate to create the models.

  2. Create notifications via the API endpoints, in code or your Admin portal.

Requirements

  • Python 3.0 or higher
  • Django 3.0 or higher
  • Django Rest Framework
    • NOTE: not only must you have this installed, you must have set DEFAULT_AUTHENTICATION_CLASSES and DEFAULT_PAGINATION_CLASS in your settings.py to work with the APIs properly. An example config would be:
REST_FRAMEWORK = {
    "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
    "PAGE_SIZE": 20,
    "DEFAULT_AUTHENTICATION_CLASSES": (
        "rest_framework.authentication.TokenAuthentication",
    ),
}

Available Settings

  • IN_TEST - Whether running in tests or not. Used to determine whether to actually send email.

Usage

The main way to interact with this app is to create and use the appropriate models and their managers' methods as needed.

Also included is the NotificationManager a class to expose some common functionality and maintain object permissions.

Some available methods currently are:

  • get_notifications_push/email/basic/all
    • Enforce object ownership and notification 'direction'
  • mark_notification_basic_read

Docs

Model docs.

API docs.

Email Template docs.

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-dans-notifications-1.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_dans_notifications-1.1.0-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file django-dans-notifications-1.1.0.tar.gz.

File metadata

File hashes

Hashes for django-dans-notifications-1.1.0.tar.gz
Algorithm Hash digest
SHA256 27300928b70f72b60bca12c7bc7f3b54bdad6e5ff4ee784f1584ee8dbb89b2df
MD5 77a2108cf8354eff44874ced1cdb8de3
BLAKE2b-256 4ec19297abfdff337934bf007df06eceb226a8b6e2a8265ce8c974d908c0c5e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_dans_notifications-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f02774c5cfe5ebb247bc18be7973600459a1afed51a4d819569455342f64dd1e
MD5 7d63e02d8ddf3a9710ace072bf405c54
BLAKE2b-256 c830869ef12d3a759cec50660286b88acd6fe2b2827acb7b1dcf0ddf32d060c4

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