Jinja2 cache

1
2
3
4
5
6
7
8
from jinja2 import Environment, FileSystemLoader, MemcachedBytecodeCache
cache = MemcachedBytecodeCache({})
Environment(loader=FileSystemLoader(
template_path), auto_reload=True, bytecode_cache=cache)
def url_for(data):
url = app.router['route_name'].url(query={'a': 1, 'b': 2})