import aiohttp from aiohttp_jinja2 import template @template('index.html') async def index(request): return {} async def button_clicked(request): return aiohttp.web.json_response({'result':'Button was clicked'})