Closed dalepotter closed 7 years ago
Hi!
JinjaTemplate constructor receives unicode string as first argument, so try T(open('template.html').read())
For non-ascii content you should probably decode text to unicode: T(open('template.html').read().decode('latin-1'))
Hi, nice library!
Is it possible to import a template from an external file (for example
template.html
)? I've adapted the example code in the docs, but am getting aTypeError
- see below.If this is possible, I'm happy to send a pull request to extend the docs examples.
sendemail.py
This gives: