This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

`pushnote`_ is a simple django plugin for sending push messages from
django server to sockjs clients. It internally uses `zeromq`_ and
`sockjs-tornado`_. pushnote can send push notifications to all sockjs
clients and to subset of this clients.


1. `pyzmq`_>=2.0
2. `sockjs-tornado`_>=0.0.5
3. `django`_>=1.4


Install ``pushnote`` with your favorite Python package manager:


pip install pushnote

Add ``pushnote`` to your ``INSTALLED_APPS`` in ````



Define ``PUSHNOTE_MQ_SOCKET`` in ````




Run pushnote forwarder device


pushnote-mq --sub=tcp:// --pub=tcp://

Run sockjs-tornado server


pushnote-server --port=8080 --mq_socket=tcp:// --route=/sockjs --address=''

Alternatively, if you don't need multiple tornado instances support, you can entirely omit pushnote-mq and should pass -S/--single argument to pushnote-server


pushnote-server --single --port=8080 --mq_socket=tcp:// --route=/sockjs --address=''

Append sockjs client library to your page


<script src="">

Open page in browser and connect to sockjs-tornado server


conn = new SockJS('http://localhost:8080/sockjs')

Define a callback for incoming messages


conn.onmessage = function (e){ console.log(; };

Send a message from django


from import notify_all
notify_all({'msg': u'Hi all!'})

and you will see it in js console


Object {msg: "Hi all!"}

Advanced notifications:

You can send notifications to subset of users.


from import notify
from pushnote.utils import tokenize
from django.contrib.auth.models import User
user = User.objects.get(email='')
notify({'msg': u'Hi, %s!' % user.username}, users=[user])
token = tokenize(user)
notify({'msg': u'Hi user with token %s !' % token}, users=[user])

To get this messages you need to subscribe by token


var token = {% pushnote_token %};
SockJS.prototype.emit = function (name, data) { // wrapper around SockJS.send for pushnote's protocol support
var meta_dict = {
conn = new SockJS('http://localhost:8080/sockjs')
conn.emit('subscribe', {'token': token});
conn.onmessage = function (e){ console.log(; };

``{% pushnote_token %}`` is nothing more than a wrapper around
``pushnote.utils.tokenize`` that returns signed with
standart django singing mechanism. You can configure you own salt by setting
``PUSHNOTE_SALT`` in ````. If you need more security,
you can provide your own tokenization function. It should accept django User
object and return token. Add path to this function in .


PUSHNOTE_TOKENIZER = 'pushnote.utils.tokenize'


1. pushnote serializes datetime objects with ISO 8601 format. You can parse it on client with `moment.js`_ .
2. pushnote server can handle client's messages constructed only in some specific way and can't be used for client to client communications.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pushnote- (27.1 kB) Copy SHA256 Checksum SHA256 Source Mar 30, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting