Virgodev Websocket Support
provides a uniform system for sending and receiving websocket messages
specs
- documentation for connecting django-channels
- support functions for making django-channels easy
- signal for when a message is received
- create a function to send messages to a user
- create a function to send messages to a group
Get Started
-
Install virgodev_websocket_support
pip install virgodev_websocket_support
-
Add INSTALLED_APPS setting
INSTALLED_APPS = ( "daphne", # install at the top to convert `runserver` into a websocket client "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.sites", "virgodev_websocket_support", ... )
-
Add ASGI_APPLICATION setting
ASGI_APPLICATION = 'virgodev_websocket_support.asgi.application'
or use the asgi from your own application's asgi file
from virgodev_websocket_support.asgi import application as app application = app
-
Add CHANNEL_LAYERS setting
assign the host to the same redis instance as your cache
CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", "CONFIG": { "hosts": [CACHES["default"]["LOCATION"]], "group_expiry": 60 * 10, }, }, }
Production
install and use uvicorn
Metadata
Release files for virgodev-websocket-support 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| virgodev_websocket_support-0.1.0.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| virgodev_websocket_support-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / virgodev_websocket_support-0.1.0.tar.gz
| Download URL | virgodev_websocket_support-0.1.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b176f264585c3bb9e8ec7769f1afdae7b7050439fcb19d48f1eadfe4dc10b485
|
|
BLAKE2b-256 checksum How to use checksums |
80d5aa6ab31bf0f73a19702a1b4161ec73d7933d8ecf89f491f484f69b277e97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-5-generic
|
Release files / virgodev_websocket_support-0.1.0-py3-none-any.whl
| Download URL | virgodev_websocket_support-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a2939e47af4fd2fbd204fd372fc1b771686091db06d4097aa9ac36867e91355
|
|
BLAKE2b-256 checksum How to use checksums |
cdf4c6e548df1f8da3d51fd42b3f64752242b29cbd94ac16644073b405b797f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-5-generic
|