Skip to main content

A pluggable notification system written for the Django framework.

Project description


django\_nyt does this:

.. code:: python

from django_nyt import notify

EVENT_KEY = "my_key"
notify(_("OMG! Something happened"), EVENT_KEY)

All users subscribing to ``EVENT_KEY`` will have a notification created
in their stack. If you have emails enabled, they may get a summary of
notifications at an interval of their choice.

Data can be accessed easily from Django models or from the included JSON

Why should you do this?

Users need an cleverly sifted stream of events. Ensure that they have
the possibility of customizing what they deem fit for their stream.

What do you need to do?

You need to do a lot. Firstly, you need to write some javascript that
will fetch the latest notifications and display them in some area of the
screen. Upon clicking that icon, the latest notifications are displayed.
Something like this:

.. figure:: ./docs/misc/screenshot_dropdown.png
:alt: Javascript drop-down

Javascript drop-down
Here is a snippet example to get you started, but you need to get ui.js
`django-wiki/plugins/notifications <>`__
which is a couple of utility functions that use JQuery to get
notifications from a JSON view and display them in the right DOM

.. code:: html

<li class="notifications-empty"><a href="#"><em>{% trans "No notifications" %}</em></a></li>
<li class="divider"></li>
<a href="#" onclick="notify_mark_read()">
<i class="icon-check"></i>
{% trans "Clear notifications list" %}
<!-- Example of a settings page linked directly under the notifications -->
<a href="{% url 'wiki:notification_settings' %}">
<i class="icon-wrench"></i>
{% trans "Notification settings" %}
<script type="text/javascript">
URL_NOTIFY_GET_NEW = "{% url "notify:json_get" %}";
URL_NOTIFY_MARK_READ = "{% url "notify:json_mark_read_base" %}";
URL_NOTIFY_GOTO = "{% url "notify:goto_base" %}";
<script type="text/javascript" src="{{ STATIC_URL }}wiki/plugins/notifications/js/ui.js"></script>




Please visit #django-wiki on as many django-wiki users
are also familiar with django-nyt which previously lived inside

*This is a work in progress*


- Missing email functionality
- Functions to easily retrive notifications and mark them as read
- Some easy-to-use template tags and templates to override.
- Examples of how to extend

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-nyt-0.9.tar.gz (39.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page