On Tue, Feb 7, 2012 at 4:35 PM, Craig Younkins <[email protected]> wrote:
> I'd like to have a 2-stage compilation of my templates. The first
> stage of compilation is at application start, where I can interpolate
> things that will be immutable for the lifetime of the application
> instance, such as domain names and build-specific caching keys. The
> second stage is for things dependent upon the request. The first stage
> would need to ignore control structures and variables for which the
> context is not available.
>
> How can I achieve this? Is there any built-in way to do this? Could I
> fake it with different control characters, such as [[ and [% instead
> of {{ and {% ? Thanks!
>
You could write a custom tag to output the raw template data on the first
pass. Or maybe use this cache tag (or something similar) and cache the
data instead of complicating the compile process:
http://jinja.pocoo.org/docs/extensions/#example-extension
--
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en.