Try Jinja2 a full featured template engine for Python