Django Websocket for Django
Project description
Tornado WebSocket server backed with PikaClient connected on RabbitMQ.
The goal of this architecture is to provide a way to integrate full duplex websockets in synchronous application with RabbitMQ as message bus.
Server is Tornado WebSocketHandler with a PikaClient consumer.
Installation
git clone https://github.com/toxinu/django-bagou.git cd django-bagou/example virtualenv virtenv source virtenv/source/activate pip install django pip install -e .. python manage.py runserver # In another terminal python manage.py runwebsocket # Go to http://localhost:8000
Incoming
For example, incoming websocket messages from Tornado are pushed to a queue (Celery for example) or just computed.
Browser send websocket message
Tornado received it * Sending AMQP message * Run Celery task (from Django?)
Torndo reply to websocket
Browser received websocket message
Sending
Django application can publish messages on RabbitMQ, which will be consumed by Pika and pushed to websockets.
Running arbitary Python code
Send AMQP message to websocket queue
PikaClient wich run with Tornado consumed it
PikaClient tell Tornado to send websocket message to browser
Browser received websocket message
Todo
Channel permission
User authentification based on sessionid
Integrated with Celery ?
Helpers for getting channels
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-bagou-0.1.1.tar.gz
.
File metadata
- Download URL: django-bagou-0.1.1.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 304c5d51916e4aae2861a168da4713ef052d7001cbbe39c27f83f2e7cfba4697 |
|
MD5 | 18a88d4a75b4903ea48ad48e033bfe17 |
|
BLAKE2b-256 | cdcd9c36f262d36d82a3fac3133d0de6eb61275a46ae0fff923f3b17981620e1 |