Skip to main content

No project description provided

Project description

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

  1. Install virgodev_websocket_support

    pip install virgodev_websocket_support
    
  2. 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",
        ...
    )
    
  3. 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
    
  4. 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

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

virgodev_websocket_support-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file virgodev_websocket_support-0.1.0.tar.gz.

File metadata

  • Download URL: virgodev_websocket_support-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.5.0-5-generic

File hashes

Hashes for virgodev_websocket_support-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b176f264585c3bb9e8ec7769f1afdae7b7050439fcb19d48f1eadfe4dc10b485
MD5 7998277cf3aed11ca893aac002c20ec7
BLAKE2b-256 80d5aa6ab31bf0f73a19702a1b4161ec73d7933d8ecf89f491f484f69b277e97

See more details on using hashes here.

File details

Details for the file virgodev_websocket_support-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for virgodev_websocket_support-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a2939e47af4fd2fbd204fd372fc1b771686091db06d4097aa9ac36867e91355
MD5 e9d5086457ce1b27ff9ac68cc7561098
BLAKE2b-256 cdf4c6e548df1f8da3d51fd42b3f64752242b29cbd94ac16644073b405b797f6

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