Source code for pythonie.blueprints.templates
"""Examples of templates
"""
import flask
blueprint = flask.Blueprint("templates", __name__, template_folder="templates")
@blueprint.route("/")
@blueprint.route("/<message>")
[docs]def index(message="from a template"):
"""Renders a page using a template
:param message: Optional message to display
To see in action:
- http://building-webapps-with-flask.herokuapp.com/templates/
- http://building-webapps-with-flask.herokuapp.com/templates/mick
"""
return flask.render_template("index.html", message=message)