Skip to main content
Help us improve Python packaging – donate today!

Wamp Client for Django Channels

Project Description

Installation

$ pip install django-wamp-client

Add channels and wampclient to your INSTALLED_APPS:

INSTALLED_APPS = [
    'channels',
    'wampclient',
]

In your settings, configure your connection to the WAMP Router:

WAMP_CONNECTION = {
    'URL': "ws://127.0.0.1:9100/ws",
    'AUTHID': 'authid',
    'AUTHSECRET': 'secret',
    'REALM': "realname",
}

Configure your routing to include wampclient.routing:

channel_routing = [
    route("wamp.join", "testproject.consumers.wamp_join"),
    include('wampclient.routing'),
]

Start the channel workers:

$ ./manage.py runworker

Start the client that will connect to the WAMP Router:

$ ./manage.py wamp_client

Usage

from wampclient import publish, subscribe


def wamp_hello(greeting):
    publish('com.example.hello', "'sup?")


def wamp_join(message):
    # This consumer will be connected to the ``wamp.join`` channel
    subscribe('com.example.hello', wamp_hello)
    publish('com.example.hello', "Hi!", options={'exclude_me': False})

LICENSE

This software is released under the MIT License. See the LICENSE file.

Status

This project should be considered a proof of concept.

Release history Release notifications

This version
History Node

0.0.3

History Node

0.0.2

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_wamp_client-0.0.3-py2.py3-none-any.whl (5.7 kB) Copy SHA256 hash SHA256 Wheel 3.4 Jul 28, 2016
django-wamp-client-0.0.3.tar.gz (4.2 kB) Copy SHA256 hash SHA256 Source None Jul 28, 2016

Supported by

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