Since Django now supports async views, I'm trying to change my code base which contains a lot of function based views to be async but for some reason its not working.
@api_view(["GET"])
async def test_async_view(request):
...
data = await get_data()
return Response(data)
When I send a request to this endpoint, I get an error saying:
AssertionError: Expected a
Response
,HttpResponse
orHttpStreamingResponse
to be returned from the view, but received a<class 'coroutine'>
Does DRF not support async views yet? Is there an alternative I can do to get this working?