A Django app to handle notifications.
Project description
Django Dans Notifications
Description
A Django app to handle notifications.
Support for basic notifications, push notifications and email notifications.
Quick start
- Add "django_dans_notifications" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
...
'django_dans_notifications',
]
- Include the notifications URLconf in your project urls.py for the REST API endpoints like this:
path("api/notifications/", include("django_dans_notifications.urls")),
-
Run
python manage.py migrate
to create the models. -
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
andDEFAULT_PAGINATION_CLASS
in yoursettings.py
to work with the APIs properly. An example config would be:
- NOTE: not only must you have this installed, you must have set
REST_FRAMEWORK = {
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
"PAGE_SIZE": 20,
"DEFAULT_AUTHENTICATION_CLASSES": (
"rest_framework.authentication.TokenAuthentication",
),
}
Available Settings
TEAM_NAME
- Default team name to use for emails, can be added to message context manually as well still.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
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
Built Distribution
Close
Hashes for django-dans-notifications-1.1.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fda8a497cab0ecaa631fc88eadf8678cb7c72f3ecfb2679a22b57bccf18c58d |
|
MD5 | ba73714c12eb02a55bc7814b088387c8 |
|
BLAKE2b-256 | 802512ab33849815b5a7940ae0ba2951ee1f8f1b6f9fc5ef588e05a7eb31c5b1 |
Close
Hashes for django_dans_notifications-1.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e3cf7aaa4a21f80de35ee84dc538db7f5c7dc2753b8a6bc72391bdfea3cbe5f |
|
MD5 | 46bd2cc9cc80fd6adb623b159624aa81 |
|
BLAKE2b-256 | 69e41bc7fbcf1637edf6c4ccbb2f460b16c0b90ae208f3e7ca79c3fcd121f04d |