Reference
The following is a reference of modules and their public functions and classes.
Please note that this documentation is not versioned. The reference for the last successful build of the main
branch is displayed.
asgi
¶
Public function for ASGI Application with custom ASGI handler.
get_asgi_application()
¶
The public interface to Django's custom ASGI support that supports the lifespan protocol.
This is modified copy of
https://github.com/django/django/blob/main/django/core/asgi.py
:return: An ASGI 3 callable.
Source code in django_asgi_lifespan/asgi.py
dispatcher
¶
errors
¶
events
¶
send_lifespan_signal_collecting_contexts(signal, scope)
async
¶
Dispatches the given signal. Returns a list of async context managers.
Source code in django_asgi_lifespan/events.py
send_lifespan_signal_compat(*, signal, scope)
async
¶
Dispatches the given signal.
Source code in django_asgi_lifespan/events.py
handler
¶
Subclass of Django ASGIHandler with ASGI Lifespan support.
LifespanASGIHandler
¶
Bases: ASGIHandler
A subclass of ASGIHandler that supports the ASGI Lifespan protocol.
Source code in django_asgi_lifespan/handler.py
__call__(scope, receive, send)
async
¶
If scope type is lifespan, handle lifespan request. Otherwise, delegate to the superclass call method.
The base Django ASGIHandler
can only handle http scope.
Source code in django_asgi_lifespan/handler.py
middleware
¶
register
¶
register_lifespan_manager(*, context_manager)
¶
Registers a context manager for lifecycle events
Source code in django_asgi_lifespan/register.py
signals
¶
ASGI lifespan Django signals for server startup and shutdown events.