Snippets are unofficial and unmaintained.
This is an archived view of user-submitted snippets. Despite being hosted on the Flask site, they are not official. No Flask maintainer has curated or checked the snippets for security, correctness, or design.
Jinja is a very nice text-based templating engine, but if you want an XML-based templating engine, Genshi is a good choice.
Flask-Genshi is a Flask extension that makes it easy. First install it:
$ easy_install Flask-Genshi
Here's a simple app:
from flask import Flask from flaskext.genshi import Genshi, render_response app = Flask(__name__) genshi = Genshi(app) @app.route('/') def index(): render_response('index.html')
For documentation on Genshi see the Genshi wiki.
This snippet by Dag Odenhall can be used freely for anything you like. Consider it public domain.