TemplateEngine — Aquilia Documentation
Comprehensive guide and documentation for TemplateEngine in the Aquilia framework. View API reference, examples, and implementation patterns.
Templates / TemplateEngine TemplateEngine API The TemplateEngine class governs Jinja2 parsing environments, resolves namespaced sources, loads precompiled bytecode caches, and applies sandboxing rules. Method API Reference , request_ctx=ctx ) return html_content` }, ) return markup` }, , request_ctx=ctx ): yield chunk` }, , status=200, headers= , request_ctx=ctx )` }, , status=200, headers= , request_ctx=ctx )` }, ")` }, .html")` }, }).', code: `def register_formatting_filters(self): # Register custom filters dynamically into the template environment self.templates.register_filter( name="obfuscate_email", func=lambda val: val.split("@")[0][:3] + "***@" + val.split("@")[1] )` }, ") self.templates.register_global("check_feature_flag", lambda flag: self.flags.enabled(flag))` } ].map((item, i) => ( ))} Built-in Filters AquilaTemplates extends Jinja2 with a set of default data formatters. Here is how they are used inside templates: } Joined on: July 09, 2026 -->` }, } Total: $1,240.50 -->` }, } } You have 3 items -->` }, } Hello World -->` }, }; ` } ].map((item, i) => ( ))} Bytecode Caching Templates are compiled into python bytecode. Choose from two distinct caching behaviors: MemoryBytecodeCache Stores compiled abstract syntax tree nodes entirely inside RAM. Fast execution speeds, ideal for ephemeral container dynos and cloud functions. SurpBytecodeCache Compiles templates into a single compressed `.surp` archive. HMAC signatures verify the bytecode integrity on startup to prevent local file tampering. Overview Loaders )
Go to Homepage