Skip to content

Instantly share code, notes, and snippets.

@codeboy
Last active October 8, 2019 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeboy/13add874908081de672ec74e184706a7 to your computer and use it in GitHub Desktop.
Save codeboy/13add874908081de672ec74e184706a7 to your computer and use it in GitHub Desktop.
aiohttp fix debug toolbar
import aiohttp_jinja2
from aiohttp import web
class CommonView(web.View):
async def render(self, template_name, request, params):
response = aiohttp_jinja2.render_template(
template_name,
request,
params
)
return response
def __iter__(self):
return self._iter().__await__()
class SettingsView(CommonView):
async def get(self):
response = await self.render(
'settings.html',
self.request,
{
'title': 'main'
}
)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment