Skip to main content

Channels for Leonardo CMS. As an example this module has implemented django-messages.

Installation

pip install leonardo-channels

Integrate

var basepath = "ws://" + window.location.hostname + ":" + window.location.port;

socket = new WebSocket(basepath + "/messages?session_key={{ request.session.session_key }}");

/* Bind django-messages */
socket.onmessage = function(e) {
    msg = JSON.parse(e.data)
    horizon.alert(msg.level, msg.message, msg.extra_tags)
}

Use from python

from leonardo_channels import router
router.route("websocket.connect", ws_add)
router.include("websocket.myroutes", path=r"/chat")

Use channels for messages

from leonardo_channels.messages import add_message
add_message(user, level, message)

Read More

Download files

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

Source Distribution

leonardo-channels-0.0.2.tar.gz (23.8 kB view details)

Uploaded Source

File details

Details for the file leonardo-channels-0.0.2.tar.gz.

File metadata

File hashes

Hashes for leonardo-channels-0.0.2.tar.gz
Algorithm Hash digest
SHA256 83af688e464c5e118f444a5c7cc06f11a7b3f4e6cedf6a05d926cfec16d27610
MD5 57724a147a146f671795c690dab0b9a6
BLAKE2b-256 4381d3f6197cb6a3f42e857655da51fc3678aa00cb1aff3db7b99c1a03940be6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 file

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page