Add get_response_async for ASGIStaticFilesHandler
It looks like the StaticFilesHandlerMixin is missing the the async response function.
Without this, when trying to use the ASGIStaticFilesHandler, this is the traceback:
Exception inside application: 'NoneType' object is not callable
Traceback (most recent call last):
File ".../lib/python3.7/site-packages/daphne/cli.py", line 30, in asgi
await self.app(scope, receive, send)
File ".../src/django/django/contrib/staticfiles/handlers.py", line 86, in __call__
return await super().__call__(scope, receive, send)
File ".../src/django/django/core/handlers/asgi.py", line 161, in __call__
response = await self.get_response_async(request)
File ".../src/django/django/core/handlers/base.py", line 148, in get_response_async
response = await self._middleware_chain(request)
TypeError: 'NoneType' object is not callable
Change History
(6)
Summary: |
Add get_response_async for ASGIStaticFilesHandlerMixin → Add get_response_async for ASGIStaticFilesHandler
|
Patch needs improvement: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Needs tests: |
set
|
Patch needs improvement: |
unset
|
Component: |
Uncategorized → contrib.staticfiles
|
Needs tests: |
unset
|
Owner: |
changed from nobody to Joshua Massover
|
Status: |
new → assigned
|
Triage Stage: |
Accepted → Ready for checkin
|
Version: |
3.0 → 3.1
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Left comments on the PR regarding the fact the we don't have a way of serving files asynchronously so far. From what I know local file I/O requires some form of thread pooling to work correctly.