__init__(self,
source,
filepath=None,
filename=None,
loader=None,
encoding=None,
lookup=' strict ' ,
allow_exec=True)
(Constructor)
|
|
Initialize a template from either a string, a file-like object, or
an already parsed markup stream.
- Parameters:
source - a string, file-like object, or markup stream to read the
template from
filepath - the absolute path to the template file
filename - the path to the template file relative to the search
path
loader - the TemplateLoader to use for loading included
templates
encoding - the encoding of the source
lookup - the variable lookup mechanism; either "strict" (the
default), "lenient", or a custom lookup class
allow_exec - whether Python code blocks in templates should be
allowed
- Overrides:
object.__init__
Note:
Changed in 0.5: Added the allow_exec argument
|