[ad_1]
I test 2 views in Django 3.2:
def sync_view(request):
return HttpResponse("Hello, sync Django!")
async def async_view(request):
await asyncio.sleep(10)
return HttpResponse("Hello, async Django!")
start uvicorn as
uvicorn myapp.asgi:application
First request to async_view
, right after to sync_view
. My expectation that sync_view
will response immediately, however it is handled only after 10 seconds. What is wrong? Why requests are not handled simultaneously?
[ad_2]