Skip to main content

txasgiresource is ASGI implemented as a Twisted Web Resource, very similar to WSGIResource.

This is inspired by Daphne but somewhat implemented from specs.

It can also run as a daemon.

The code is available on GitHub

Usage

As Twisted Resource

from twisted.web import server

from yourdjangoproject.routing import application

resource = ASGIResource(application)
site = server.Site(resource)

# If we are done with the resource, make sure to stop it.

yield resource.stop()

As ASGI Protocol server

twistd -n txasgi -a yourdjangoproject.routing:application

As ASGI Protocol server on a different port and ip

twistd -n txasgi -a yourdjangoproject.asgi:channel_layer -d tcp:5566:interface=0.0.0.0

Supported specifications

Specification

Supported

asgi2

Yes, through compatibility handler

asgi3

Yes

HTTP

Yes, v2.0

Websocket

Yes, v2.0

Lifespan

No

Status

Master branch

https://coveralls.io/repos/github/JohnDoee/txasgiresource/badge.svg?branch=master https://travis-ci.org/JohnDoee/txasgiresource.svg?branch=master

Develop branch

https://coveralls.io/repos/github/JohnDoee/txasgiresource/badge.svg?branch=develop https://travis-ci.org/JohnDoee/txasgiresource.svg?branch=develop

License

MIT, see LICENSE

Metadata

Release files for txasgiresource 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for txasgiresource 2.2.1
File Interpreter ABI Platform
txasgiresource-2.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / txasgiresource-2.2.1-py2.py3-none-any.whl

Download URL txasgiresource-2.2.1-py2.py3-none-any.whl
Size 19.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
97a3749799811537ab020b81373c02aeb06540fea75dc80248a437fa0c561f41
BLAKE2b-256 checksum
How to use checksums
e79dc70c6a46726f7810c54e956fc18475dd46b7ac880f07531dd469212685a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

Release history Release notifications | RSS feed

This release

2.2.1 This release

1 release file

2.2.0

1 release file

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page