Skip to content

dan1229/django_dans_notifications

Repository files navigation

Django Dans Notifications

Lint Test Types codecov

Python Versions Django Versions PyPI Version Downloads License Codacy grade Code style

Description

A Django app to handle notifications.

Support for basic notifications, push notifications, and email notifications.

Available on PyPi

Quick Start

pip install django-dans-notifications

See the Getting Started Guide for detailed installation and configuration instructions.

Requirements

  • Python 3.8 or higher
  • Django 3.1 or higher
  • Django Rest Framework (with authentication configured)

Basic Usage

from django_dans_notifications.models.notifications import NotificationEmail

# Send an email notification
notification = NotificationEmail.objects.send_email(
    subject="Welcome",
    template="django-dans-emails/default.html",
    sender="noreply@example.com",
    recipients=["user@example.com"],
    context={"team_name": "My Team"}
)

See the Usage Guide for more examples and advanced usage.

Features

Models

  • NotificationEmail: Handles email notifications.
  • NotificationBasic: Handles basic notifications.
  • NotificationPush: Handles push notifications.

Managers

  • NotificationEmailManager: Handles sending and managing email notifications.
  • NotificationBasicManager: Handles basic notifications.
  • NotificationPushManager: Handles push notifications.

API ViewSets

  • NotificationEmailViewSet: API endpoints for email notifications.
  • NotificationBasicViewSet: API endpoints for basic notifications.
  • NotificationPushViewSet: API endpoints for push notifications.

Utility Classes

  • NotificationManager: Exposes common functionality and maintains object permissions.
    • Methods: get_notifications_push/email/basic/all, mark_notification_basic_read.

Documentation

Support

For issues, questions, or contributions, please visit the GitHub repository.


Copyright 2024 © Daniel Nazarian.

About

A Django app to help handle and manage notifications via basic models, APIs and helper functions

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published