Skip to main content

SocketIO for Django

Project description

PyPI version codecov

Django SocketIO (django-sio)

Socket.IO for Django, powered by Channels and compatible with the official Socket.IO clients.

📖 Documentation: django-sio.readthedocs.io 🐍 PyPI: pypi.org/project/django-sio/ 🚀 Demo project: django-sio-chat-demo


Code Coverage

Repository graph

Development Setup

Clone the repository and install dependencies using uv:

# Install dependencies
uv sync

# Editable install
uv pip install -e .

Building Documentation

This project uses sphinx.

uv run make html

See documentation in build/ directory.

Running Tests

Execute the test suite with:

uv run pytest -sq
uv run pytest -sq --durations=10  # To get 10 slowest tests
uv run pytest --cov=. --cov-report=html  # To generate code coverage report

# To run js_client tests make sure you do `npm install` before
uv run pytest -vv -s tests/js_client/test_js_client_integration.py --run-js
# To run js_client tests till first failure
JS_BAIL=1 \
  uv run pytest -vv -s tests/js_client/test_js_client_integration.py --run-js
# To run specific js_client tests. Alternatively use it.only() or to skip it.skip().
SIO_TRANSPORT=default JS_GREP="should forcefully close the session" \
  uv run pytest -vv -s tests/js_client/test_js_client_integration.py --run-js

Running Linters and Formatters

uv run ruff format --check
uv run ruff format
uv run docformatter . --check
uv run docformatter --in-place .
uv run ruff check
npx eslint tests/js_client
npx eslint tests/js_client --fix

Running with tox

Run the full tox matrix:

uv run tox

List the tox matrix:

$ uv run tox -l
... # past support
py39-dj42
py310-dj42
py311-dj42
py312-dj42
py310-dj51
py311-dj51
py312-dj51
py313-dj51
py310-dj52
py311-dj52
py312-dj52
py313-dj52
py314-dj52
py312-dj60
py313-dj60
py314-dj60
py312-djmain
py313-djmain
py314-djmain
... # future support
qa
qa-js

# run the tests with python 3.14, on Django 5.2 and main branch with linting or code quality assurance.
$ uv run tox -e py314-dj52,py314-djmain,qa

Note that tox can also forward arguments to pytest. For example, forward the -sq or --run-js flag to pytest as such:

uv run tox -e py314-djmain -- -sq --run-js

Contributing

Contributions are welcome! Please open issues or pull requests to help improve the package.

Release

To create a release:

git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0

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

django_sio-0.2.0.tar.gz (54.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sio-0.2.0-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file django_sio-0.2.0.tar.gz.

File metadata

  • Download URL: django_sio-0.2.0.tar.gz
  • Upload date:
  • Size: 54.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_sio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5a5b0c5677524fdf8723b8f253df1a930a80305ef08a692748634848e5e1fa25
MD5 2f53dcd828395486576722dfefe5e655
BLAKE2b-256 37d82729e6b0b47be4e4ec9e5cc58c65c8e7016dc4ae189f86be00004f3999f5

See more details on using hashes here.

File details

Details for the file django_sio-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: django_sio-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for django_sio-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0bab7d28e252417a8743cdf027b1ccd785e740393a0bd61ef85b8a2754b817f
MD5 c01984bb799e326331cdf0e017298f7a
BLAKE2b-256 a9e7cb6f83ae859124d57fe5082c9b78654dad43ac5041e318f7753196148d28

See more details on using hashes here.

Supported by

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