get_asgi_application[source]

get_asgi_application()

Similar to django.core.asgi.get_asgi_application, but uses AsyncFileASGIHandler instead of Djangos ASGIHandler.

Usage

from fileresponse.asgi import get_asgi_application

application = get_asgi_application()

Tests

Assert application class is AsyncFileASGIHandler

from django.conf import settings

try:
    settings.configure()
except RuntimeError:
    pass

application = get_asgi_application()
assert "<class 'fileresponse.handlers.AsyncFileASGIHandler'>" == str(
    application.__class__
)

Assert application is not the standard Django asgi application

from django.core.asgi import get_asgi_application as get_django_asgi_application

assert get_django_asgi_application() != application