pip install relatorio
python
from flask import Flask, render_template
from relatorio.templates.opendocument import Template
app = Flask(__name__)
@app.route('/')
def index():
template = Template("report_template.odt")
context = {
'name': 'John Doe',
'age': 30,
'address': '123 Main St'
}
report = template.generate(**context)
return render_template('index.html', report=report)
if __name__ == '__main__':
app.run()
html
<!DOCTYPE html>
<html>
<head>
<title>Relatorio Report</title>
</head>
<body>
<h1>Relatorio Report</h1>
{{ report }}
</body>
</html>