Skip to main content

django-whistle

Django Whistle is a Django app that provides a simple way to send notifications via different channels. Currently supports web, push, email channels.

Basic Usage

  1. Installation: Install Django Whistle using pip:
pip install django-whistle
  1. Configuration in settings: Add 'whistle' to your INSTALLED_APPS in the Django project settings:
# settings.py

INSTALLED_APPS = [
   # ...
   'whistle',
]

Configuration

Customize Django Whistle by configuring settings in your project's settings.py:

Basics

Setup events and channels for notifications like this: Pro tip, you can use TextChoices for events.

 # settings.py

WHISTLE_CHANNELS = ['web', 'push', 'email']
WHISTLE_NOTIFICATION_EVENTS = (
    ('NAME_OF_EVENT', gettext_lazy('Object %(object)r was updated')
)
### Custom Notification Manager/Handlers

You can ovverride the logic of sending notifications by creating custom manager or handler. Handler is for general
availability of event/channel, and managers is for defining the behaviour. For example, you can use it to customize
emails, add context to emails, or for whatever you miss in the default implementation.

```python
# settings.py

WHISTLE_EMAIL_MANAGER_CLASS = "bidding.notifications.managers.CustomEmailManager"
WHISTLE_NOTIFICATION_MANAGER_CLASS = (
    "bidding.notifications.managers.CustomNotificationManager"
)
WHISTLE_AVAILABILITY_HANDLER = "bidding.notifications.handlers.availability_handler"

Asynchronous Notifications

You can send notifications asynchronously using queues.

# settings.py

WHISTLE_REDIS_QUEUE = None
WHISTLE_USE_RQ = False
RQ_QUEUES = None
WHISTLE_CACHE_TIMEOUT = None  # infinite

Running the tests

Explain how to run the automated tests for this system

Break down into end to end tests

Explain what these tests test and why

Give an example

And coding style tests

Explain what these tests test and why

Give an example

Deployment

Add additional notes about how to deploy this on a live system

Built With

  • Dropwizard - The web framework used
  • Maven - Dependency Management
  • ROME - Used to generate RSS Feeds

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to anyone who's code was used
  • Inspiration
  • etc

Metadata

Release files for django-whistle 5.0.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-whistle 5.0.0
File Size Uploaded
django-whistle-5.0.0.tar.gz 30.7 kB Details

Release files / django-whistle-5.0.0.tar.gz

Download URL django-whistle-5.0.0.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e3b4b15676a623009db57d5eddcf5e5b77459341265d3cb99c4fead0a33f29aa
BLAKE2b-256 checksum
How to use checksums
f4cb963ab182976d629cfeb4057d4c872bc07a2c2da4542ce9ddd249008db2b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.18

Release history Release notifications | RSS feed

7.1.0

1 release file

7.0.0

1 release file

6.0.1

1 release file

6.0.0

1 release file

5.0.1

1 release file

This release

5.0.0 This release

1 release file

4.2.1

1 release file

4.2.0

1 release file

4.1.0

1 release file

4.0.0

1 release file

3.5.0

1 release file

3.4.2

1 release file

3.4.1

1 release file

3.4.0

1 release file

3.3.1

1 release file

3.3.0

1 release file

3.2.0

1 release file

3.1.6

1 release file

3.1.5

1 release file

3.1.4

1 release file

3.1.3

1 release file

3.1.2

1 release file

3.1.1

1 release file

3.1.0

1 release file

3.0.0

1 release file

2.5.0

1 release file

2.4.2

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.0

1 release file

2.2.1

1 release file

2.2.0

1 release file

2.1.3

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0.0

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.9.0

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

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