Last active
October 8, 2019 04:15
-
-
Save codeboy/13add874908081de672ec74e184706a7 to your computer and use it in GitHub Desktop.
aiohttp fix debug toolbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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