Django - Async Django
Which of the following is the correct way to define an async view in Django?
async def and can return a response directly.async def and returns a response. def my_view(request): return HttpResponse('Hello') is a normal sync view. async def my_view(request): await HttpResponse('Hello') wrongly uses await on a response object, which is not awaitable. def async my_view(request): return HttpResponse('Hello') has invalid syntax.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions