Skip to main content

Channels for Leonardo CMS.

Project description

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

Project details


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.1.dev16.tar.gz (23.7 kB view details)

Uploaded Source

File details

Details for the file leonardo-channels-0.0.1.dev16.tar.gz.

File metadata

File hashes

Hashes for leonardo-channels-0.0.1.dev16.tar.gz
Algorithm Hash digest
SHA256 756e07e8a32b4e9ef58d74710990f359c9dcf1d988d492bebe5bd1a2743d0095
MD5 c16ad57a8ddc11ad90f20aa844be1052
BLAKE2b-256 c4a0f0760eff72569fed0be6bea09b1099c40e218659afc35834090aa8f2d730

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page