Skip to main content

SocketIO for Django

Project description

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/


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.

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.1.0.tar.gz (49.3 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.1.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_sio-0.1.0.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.1.0.tar.gz
Algorithm Hash digest
SHA256 19be33a3fd2b670e626007158bd4f3927d1d2c7ec8e0cb8965084579ff4c5dd6
MD5 a79e0d8c52a319f5018b1d48949e2a2b
BLAKE2b-256 b7cfe7a48b148f9ef18c021d05a5a8383cbf1206381202045f1de42a69434a1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_sio-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 453dc457091a8383c3ae1fde78a00a902c46feab93a2d8ce5ad95cd5f9097317
MD5 a9718663e0719afce0dcc99b9f531776
BLAKE2b-256 e624f160ec00e50cc09c2d6e4fc60d2d58645d280eaad18f70c40d3f12841297

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