Async version of Jinja2 environment
Project description
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
})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioja-0.0.2.tar.gz
(8.9 kB
view hashes)
Built Distribution
aioja-0.0.2-py2.py3-none-any.whl
(12.5 kB
view hashes)
Close
Hashes for aioja-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeb2a1eae34a47a77f6b958586ba6d0089372bf08549aa34d65c17c93f4b1053 |
|
MD5 | 2e50c9d5f2c7b00b32acc1ec9302819b |
|
BLAKE2b-256 | c8ff70723724ab76654665d3a09ed7fbf25baa9165fdbb667b5e1ae2e325182a |