<jupyter_start><jupyter_text>Get Fileresponse ApplicationThe public interface to django_fileresponse's ASGI support.Returs an ASGI 3 callable. Uses AsyncFileASGIHandler instead of DjangosASGIHandler to enable async file responses.<jupyter_code># export

import django

from fileresponse.handlers import AsyncFileASGIHandler


def get_asgi_application():
    """
    Similar to django.core.asgi.get_asgi_application, but uses AsyncFileASGIHandler
    instead of Djangos ASGIHandler.
    """
    django.setup(set_prefix=False)
    return AsyncFileASGIHandler()<jupyter_output><empty_output><jupyter_text>Usage<jupyter_code># dont_test

from fileresponse.asgi import get_asgi_application

application = get_asgi_application()<jupyter_output><empty_output><jupyter_text>Tests  Assert application class is AsyncFileASGIHandler<jupyter_code>from django.conf import settings

try:
    settings.configure()
except RuntimeError:
    pass

application = get_asgi_application()
assert "<class 'fileresponse.handlers.AsyncFileASGIHandler'>" == str(
    application.__class__
)<jupyter_output><empty_output><jupyter_text>Assert application is not the standard Django asgi application<jupyter_code>from django.core.asgi import get_asgi_application as get_django_asgi_application

assert get_django_asgi_application() != application<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06904231625835189, 'fraction_numerical': 0.0007423904974016332, 'mean_word_length': 7.531645569620253, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '97579', 'license': 'Apache-2.0', 'n_tokens_mistral': 420, 'n_tokens_neox': 407, 'n_words': 89, 'path': 'nbs/02_asgi.ipynb', 'repo_name': 'ephes/django-fileresponse', 'size': '1347'}