The jinja API doc on pocoo.org states:
The easiest way to configure Jinja2 to download templates for your application is something like this:
from jinja2 import Environment, PackageLoader env = Environment(loader=PackageLoader('yourapplication', 'templates'))
This will create a template environment with default settings and a loader that looks for templates in the templates folder inside the python package yourapplication .
As it turned out, this is not so simple because you need to create / install a python package with your templates, which creates a lot of unnecessary complexity, especially if you are not going to distribute your code. You can address SUCH questions on the topic here and here , but the answers are vague and unsatisfactory.
Obviously, a naive beginner just wants to download the template directly from the file system, and not as a resource in the package. How to do it?
source share