Shared state with aiohttp web server Shared state with aiohttp web server python-3.x python-3.x

Shared state with aiohttp web server


Push your shared variable into application's context:

async def handle(request):    if items['test'] == 'val':        request.app['shared_item'] = 'doeda'    print(request.app['shared_item'])app = web.Application()app['shared_item'] = 'bla'