Is there a way to change the Jinja2 root directory per-request on Flask? Right now I do:
app.jinja_loader = FileSystemLoader(template_directory)
but it seems to work only once per process (the process chooses the correct directory at first and then stays there, no matter how many changes I make)…
It turns out that a Jinja caching bug is preventing the correct template from loading, so disabling the cache works: