A way to use include with .from_string() instead of file?

2016-04-14 Thread David Rueter
I am using the Jinja environment .from_string() method to create my templates from a strings stored in a database. This is working well, but I would like to be able to include templates--such as perhaps a common template for the header, a common template for the footer, etc. The Jinja Include

Re: A way to use include with .from_string() instead of file?

2016-04-14 Thread Steven Kryskalla
You'll want to write your own Loader: http://jinja.pocoo.org/docs/dev/api/#loaders "Different loaders are available and you can also write your own if you want to load templates from a database or other resources." FunctionLoader might be an easy way to get started: