template = env.get_template('index.html')
with open('index_file.html', 'w') as index_file:
    output = template.render(index_variables)
index_file.write(output.encode('utf-8'))
Использование символов utf-8 в шаблоне Jinja2