Skip to main content

ASGI implemented as a Twisted resource

Project description

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


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=

Supported specifications

Specification Supported
asgi2 Yes, through compatibility handler
asgi3 Yes
HTTP Yes, v2.0
Websocket Yes, v2.0
Lifespan No


Master branch

Develop branch



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for txasgiresource, version 2.2.1
Filename, size File type Python version Upload date Hashes
Filename, size txasgiresource-2.2.1-py2.py3-none-any.whl (19.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page