ASGIStaticFilesHandler
ASGI application which wraps another and intercepts requests for static files, passing them off to Django's static file serving.
Attributes
| Attribute | Type | Description |
|---|---|---|
| application | ASGI application | The inner ASGI application instance that this handler wraps and delegates non-static requests to. |
| base_url | ParseResult | The parsed URL components of the static files base path used to determine if an incoming request should be intercepted for static file serving. |
Constructor
Signature
def ASGIStaticFilesHandler(
application: ASGI application
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| application | ASGI application | The inner ASGI application to wrap. |
Methods
get_response_async()
@classmethod
def get_response_async(
request: [HttpRequest](../../../http/request/httprequest.md?sid=django_http_request_httprequest)
) - > [HttpResponse](../../../http/response/httpresponse.md?sid=django_http_response_httpresponse)
Asynchronously retrieves a response for a request and ensures that synchronous FileResponses are wrapped for compatibility with async streaming.
Parameters
| Name | Type | Description |
|---|---|---|
| request | [HttpRequest](../../../http/request/httprequest.md?sid=django_http_request_httprequest) | The Django request object being processed for a static file resource. |
Returns
| Type | Description |
|---|---|
[HttpResponse](../../../http/response/httpresponse.md?sid=django_http_response_httpresponse) | The processed response object, potentially modified with an async-compatible streaming content wrapper. |