env = Environment(loader=FileSystemLoader('templates'))
template = env.get_template('test.html')
output_from_parsed_template = template.render(foo='Hello World!')
print(output_from_parsed_template)
with open('my_new_file.html', 'wb') as fh:
    fh.write(output_from_parsed_template)
How do I render jinja2 output to a file in Python instead of a Browser