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

django-notifications-rest Team

Core contributors (in alphabetical order):

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.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

django_notifications_rest-1.0.2-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django_notifications_rest-1.0.2.tar.gz
Algorithm Hash digest
SHA256 391569c76f1c9ad1d3cc5896129c63d29b264a3235a2c85afc36359949cb87cc
MD5 a3b643007cc9001d306f49bcb3b06456
BLAKE2b-256 f5efd40210a4a9939ece847124fc67a2afb2590668f5edde70fa9fcc08053c68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_notifications_rest-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0faa394f4009c783644da69e89354b3e7aa217fcc634fce8d5e01b1d7885038b
MD5 c01b88a790815901da7e7ebf80f40a8b
BLAKE2b-256 ee79a892294a7f0650543076b7ed7c549924033adaafd99a16dba1ef7528021e

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