From de6df46a8194a24e6aba0fd6d3db1cc430e03cbd Mon Sep 17 00:00:00 2001 From: enrico Date: Tue, 20 Sep 2022 12:07:18 -0400 Subject: [PATCH] Wrapped func with sync_to_async --- rest_framework/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index ec907531b..c8afa2b80 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -564,7 +564,7 @@ class APIView(View): if getattr(self, 'view_is_async', False): async def handler(): - return func() + return await sync_to_async(func)() else: def handler(): return func()