Problems with Jinja2: TemplateNotFound: index.html

Try to use

loader=jinja2.FileSystemLoader('templates')

instead of

loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates'))

It works for me.


This solved it for me:

mkdir templates
echo "hello world" > templates/index.html

Well, my error was simple and silly. I have create the file "index.html" the wrong way (here the right way). So, my "index.html" file was indeed a ".text" file (because I just rename it to "index.html" instead of "save as" index.html"). Thanks for the help, guys!