I'm making a small script to generate an HTML file. For this purpose, I'm using jinja2
.
This is my script (found in the jinja2
documentation):
# -*- coding: utf-8 -*-
from jinja2 import Environment, PackageLoader
env = Environment(loader = PackageLoader('monapplication', 'templates'))
template = env.get_template('index.html')
print(template.render(message = "Bienvenue sur mon site !"))
The package "monapplication" contains the folder "templates" where my index.html file is located.
But when I run the script, I get this error:
"NotImplementedError; Can't perform this operation for unregistered loader type."
I did some research, but I didn't find any solution for my problem.
My OS is Windows 10.