I got new event loop on each request even if i use daphne as my server with Django.
view:
async def main_page(request):
loop = asyncio.get_running_loop()
return HttpResponse(id(loop))
settings: ASGI_APPLICATION = 'project.asgi.application'
start server:
daphne project.asgi:application
or
python manage.py runserver
(daphne first in installed apps)
Logs: Starting ASGI/Daphne version 4.0.0 development server at 127.0.0.1:8000
deps:
python==3.10 django==4.2.8 daphne==4.0.0 asgiref==3.7.2
It works like I'm using WSGI server - new loop on each request (according to new loop id). But id should be the same, isn't it?
How can i fix it?