Name | virgodev-websocket-support JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | |
upload_time | 2023-11-01 22:23:14 |
maintainer | |
docs_url | None |
author | Your Name |
requires_python | >3.10 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Virgodev Websocket Support
provides a uniform system for sending and receiving websocket messages
## specs
- [ ] documentation for connecting django-channels
- [x] support functions for making django-channels easy
- [x] signal for when a message is received
- [x] create a function to send messages to a user
- [x] create a function to send messages to a group
## Get Started
1. Install virgodev_websocket_support
```python
pip install virgodev_websocket_support
```
1. Add INSTALLED_APPS setting
```python
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",
...
)
```
1. Add ASGI_APPLICATION setting
```python
ASGI_APPLICATION = 'virgodev_websocket_support.asgi.application'
```
or use the asgi from your own application's asgi file
```python
from virgodev_websocket_support.asgi import application as app
application = app
```
1. Add CHANNEL_LAYERS setting
assign the host to the same redis instance as your cache
```python
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [CACHES["default"]["LOCATION"]],
"group_expiry": 60 * 10,
},
},
}
```
## Production
install and use uvicorn
Raw data
{
"_id": null,
"home_page": "",
"name": "virgodev-websocket-support",
"maintainer": "",
"docs_url": null,
"requires_python": ">3.10",
"maintainer_email": "",
"keywords": "",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/80/d5/aa6ab31bf0f73a19702a1b4161ec73d7933d8ecf89f491f484f69b277e97/virgodev_websocket_support-0.1.0.tar.gz",
"platform": null,
"description": "# Virgodev Websocket Support\n\nprovides a uniform system for sending and receiving websocket messages\n\n\n## specs\n\n- [ ] documentation for connecting django-channels\n- [x] support functions for making django-channels easy\n - [x] signal for when a message is received\n - [x] create a function to send messages to a user\n - [x] create a function to send messages to a group\n\n\n## Get Started\n\n1. Install virgodev_websocket_support\n\n ```python\n pip install virgodev_websocket_support\n ```\n\n1. Add INSTALLED_APPS setting\n\n ```python\n INSTALLED_APPS = (\n \"daphne\", # install at the top to convert `runserver` into a websocket client\n \"django.contrib.auth\",\n \"django.contrib.contenttypes\",\n \"django.contrib.sessions\",\n \"django.contrib.sites\",\n \"virgodev_websocket_support\",\n ...\n )\n ```\n\n1. Add ASGI_APPLICATION setting\n\n ```python\n ASGI_APPLICATION = 'virgodev_websocket_support.asgi.application'\n ```\n\n or use the asgi from your own application's asgi file\n\n ```python\n from virgodev_websocket_support.asgi import application as app\n application = app\n ```\n\n\n1. Add CHANNEL_LAYERS setting\n\n assign the host to the same redis instance as your cache\n\n ```python\n CHANNEL_LAYERS = {\n \"default\": {\n \"BACKEND\": \"channels_redis.core.RedisChannelLayer\",\n \"CONFIG\": {\n \"hosts\": [CACHES[\"default\"][\"LOCATION\"]],\n \"group_expiry\": 60 * 10,\n },\n },\n }\n ```\n\n## Production\n\ninstall and use uvicorn\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "cdf4c6e548df1f8da3d51fd42b3f64752242b29cbd94ac16644073b405b797f6",
"md5": "e9d5086457ce1b27ff9ac68cc7561098",
"sha256": "9a2939e47af4fd2fbd204fd372fc1b771686091db06d4097aa9ac36867e91355"
},
"downloads": -1,
"filename": "virgodev_websocket_support-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e9d5086457ce1b27ff9ac68cc7561098",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">3.10",
"size": 4857,
"upload_time": "2023-11-01T22:23:11",
"upload_time_iso_8601": "2023-11-01T22:23:11.782969Z",
"url": "https://files.pythonhosted.org/packages/cd/f4/c6e548df1f8da3d51fd42b3f64752242b29cbd94ac16644073b405b797f6/virgodev_websocket_support-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80d5aa6ab31bf0f73a19702a1b4161ec73d7933d8ecf89f491f484f69b277e97",
"md5": "7998277cf3aed11ca893aac002c20ec7",
"sha256": "b176f264585c3bb9e8ec7769f1afdae7b7050439fcb19d48f1eadfe4dc10b485"
},
"downloads": -1,
"filename": "virgodev_websocket_support-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7998277cf3aed11ca893aac002c20ec7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">3.10",
"size": 3282,
"upload_time": "2023-11-01T22:23:14",
"upload_time_iso_8601": "2023-11-01T22:23:14.232684Z",
"url": "https://files.pythonhosted.org/packages/80/d5/aa6ab31bf0f73a19702a1b4161ec73d7933d8ecf89f491f484f69b277e97/virgodev_websocket_support-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-01 22:23:14",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "virgodev-websocket-support"
}