Skip to main content

django-notifications-rest Documentation

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

Requirements

  • Python 3.11 - 3.14
  • Django 5.2 - 6.1
  • django-notifications-community latest version. It is a drop-in fork of django-notifications-hq, whose last PyPI release (1.8.3) does not run on Django 5.1+ or Python 3.12+.
  • djangorestframework latest version

Installation

Installation using pip. You need to manually install the required django-notifications-community 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

The recipient must be an existing user. actor, target and action_object are given as {"content_type_id": ..., "pk": ...}; each must be the requesting user, or an object of a model the requesting user has Django's view permission for (superusers have all permissions). Anything else is rejected with 400, the same as an object that does not exist.

django-notifications-rest Team

Core contributors (in alphabetical order):

Metadata

Release files for django-notifications-rest 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-notifications-rest 1.1.0
File Size Uploaded Provenance
django_notifications_rest-1.1.0.tar.gz 10.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-notifications-rest 1.1.0
File Interpreter ABI Platform
django_notifications_rest-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 kB

Release files / django_notifications_rest-1.1.0.tar.gz

Download URL django_notifications_rest-1.1.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cce9f1125c38b8440750f5fc6eba897ca150ff5bdabe11dae59af5ef2195978b
BLAKE2b-256 checksum
How to use checksums
0dc95959a6f27849718fdedb080db5819dd45d20746c969bb377f414961ea0c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / django_notifications_rest-1.1.0-py3-none-any.whl

Download URL django_notifications_rest-1.1.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
274312b5cef831b28734b27112f96a299215150dc528577bc79c5b575964a7b7
BLAKE2b-256 checksum
How to use checksums
d4ea039f90210eb5be11f045fa757afdadee123f0d6e89bcd46a33640875a16e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for django-notifications-rest 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page