Using pip simply by doing:

pip install django-pushserver

You should then add pushserver to INSTALLED_APPS and configure URLs used for HTTP push. For example:

    'port': 8001,
    'address': '',
    'publisher_host': {
        'location': '',
        'secure': True,
    'subscriber_host': {
        'location': '',
        'secure': False,
    'store': {
        'type': 'memory',
        'min_messages': 0,
        'max_messages': 100,
        'message_timeout': 10,
    'locations': (
            'type': 'subscriber',
            'url': r'/updates/([^/]+)',
            'polling': 'long',
            'create_on_get': True,
            'allow_origin': '',
            'allow_credentials': True,
            'passthrough': '',
            'type': 'publisher',
            'url': r'/send-update/([^/]+)',

Settings translate directly to settings of the py-hbpush package. Production settings should match those configured in Nginx.


Passthrough is not yet supported in Nginx. The implementation in django-pushserver passes original headers to a special passthrough URL so that server behind can for example from cookies determine which user has subscribed to or unsubscribed from the channel. This is useful to keep track of active users connected to the site.

You should add passthrough URLs to, matching URL configured in settings:

urlpatterns = patterns('',
    # ...

    url(r'^passthrough', include('pushserver.urls')),

    # ...

Passthrough URLs are not publicly accessible, so you should use INTERNAL_IPS to configure from which IPs they should be accessible. As you will probably run both Django development server and push server daemon on the same machine, this is probably simply:


When used in production where Nginx is making passthrough requests, it should match IP(s) on which you have Nginx running.

If you do not need or want passthrough just do not define it in PUSH_SERVER setting. Passthrough URLs and INTERNAL_IPS setting are also not needed in this case.