aioja 0.0.4

Creator: codyrutscher

Last updated:

0 purchases

aioja 0.0.4 Image
aioja 0.0.4 Images

Languages

Categories

Add to Cart

Description:

aioja 0.0.4

aioja
Async version of Jinja2.


This library contains a modification of the Jinja2 library.
In addition to Jinja's built-in render_async, i've added:

async FileSystemLoader (via aiofiles)
async bytecode cache (aioredis and aiocache supported)
async version of the Environment.compile_templates method

Install
pip install aioja

Quick Start
from aioja.environment import Environment
from aioja.loaders import FileSystemLoader
from aioja.bccache.aiocache import AioCacheBytecodeCache


env = Environment(
loader=FileSystemLoader('templates'),
# ...
# bytecode_cache=AioCacheBytecodeCache()
# ...
)

template = await env.get_template('index.html')
content = await template.render_async({
'page_id': 123
})

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.