Skip to main content

A django notifications package exposed through API Rest

Project description

django-notifications-rest Documentation

django-notifications-rest provides rest endpoints for django-notifications-hq.

Requirements

  • Python 3.8 - 3.11
  • Django 4.2 - 5.0
  • django-notifications-hq latest version
  • djangorestframework latest version

Installation

Installation using pip. You need to manually install the required django-notifications-hq and djangorestframework packages.

$ pip install django-notifications-rest

or get it from source

$ git clone https://github.com/yhdelgado/django-notifications-rest.git
$ cd django-notifications-rest
$ python setup.py sdist
$ pip install dist/django-notifications-rest*

Then to add the Django Notifications Rest to your project add the app notifications_rest to your INSTALLED_APPS and urlconf.

The app should go somewhere after all the apps that are going to be generating notifications like django.contrib.auth

INSTALLED_APPS = (
    'django.contrib.auth',
    'rest_framework',
    'notifications'.
    ...
    'notifications_rest',
    ...
)

Add the notifications urls to your urlconf::

urlpatterns = [
    ...
    url('^notifications/', include('notifications_rest.urls')),
    ...
]

If the installed version of django>=3.1, then::

from django.urls import path, include
urlpatterns = [
    ...
    path('^notifications/', include('notifications_rest.urls')),
    ...
]

To run schema migration, execute python manage.py migrate.


Additional options:

There is also /add/ API endpoint to add new notifications. Such endpoint might be considered security risk, as any user can add any notifications. For that reason, it must be manually enabled by setting NOTIFICATIONS_API_ALLOW_ADD=True

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_notifications_rest-1.0.1.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

django_notifications_rest-1.0.1-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django_notifications_rest-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django_notifications_rest-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ddc586e65ee94828b723ddaa27a9c697f3c3d94d730facdb89770ff2634e65a0
MD5 b65273f04e9ab1e05e1c1c851cde8e19
BLAKE2b-256 9afa99661bd692c22c4a2eea2479a84960b5847e7abf0630565ee3148892d933

See more details on using hashes here.

File details

Details for the file django_notifications_rest-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_notifications_rest-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4dc0599ba88254e847cfee9e371085a3925ada4e57ea7c3f2e5c103cf451238c
MD5 6fe124c02a7d8352f1b4a0d06f70a600
BLAKE2b-256 d883d0069f214d0f5a8f38ea3800819c73eb1ecf7388199273f6496a35b19683

See more details on using hashes here.

Supported by

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