Debian Codegraph @

/

debian aiohttp-mako 1.0.0-1debian python3-aiohttp-mako python aiohttp-mako 0.4.0 debianinimakemakefilepythonpythonshellyaml 22 files · 220 symbols
View dependency graph

Depends on

README (full)

aiohttp_mako

:target: https://travis-ci.com/aio-libs/aiohttp-mako

:target: https://codecov.io/gh/aio-libs/aiohttp-mako

:target: https://pypi.python.org/pypi/aiohttp-mako

:target: https://gitter.im/aio-libs/Lobby :alt: Chat on Gitter

mako template renderer for aiohttp.web_ based on aiohttp_jinja2. Library has almost same api and support python 3.5 (PEP492) syntax. It is used in aiohttp_debugtoolbar.

__ aiohttp_web

Example

 import asyncio
 import aiohttp_mako
 from aiohttp import web


 @aiohttp_mako.template('index.html')
 async def func(request):
     return {'head': 'aiohttp_mako', 'text': 'Hello World!'}

 async def init(loop):
     app = web.Application(loop=loop)
     lookup = aiohttp_mako.setup(app, input_encoding='utf-8',
                                 output_encoding='utf-8',
                                 default_filters=['decode.utf8'])
     template = """<html><body><h1>${head}</h1>${text}</body></html>"""
     lookup.put_string('index.html', template)

     app.router.add_route('GET', '/', func)
     return app

 loop = asyncio.get_event_loop()
 app = loop.run_until_complete(init(loop))
 web.run_app(app, host='127.0.0.1', port=9000)

License

aiohttp_mako is offered under the Apache 2 license.

dir aiohttp_mako/
dir debian/
dir docs/
dir examples/
dir tests/
file .gitignore
file .pyup.yml
file .travis.yml
file CHANGES.txt
file LICENSE
file MANIFEST.in
file Makefile
file README.rst
file requirements-dev.txt
file setup.cfg
file setup.py