Skip to content

Instantly share code, notes, and snippets.

@InFog
Created May 7, 2014 11:21
Show Gist options
  • Save InFog/d8c77e0b01f0dfb71c6a to your computer and use it in GitHub Desktop.
Save InFog/d8c77e0b01f0dfb71c6a to your computer and use it in GitHub Desktop.
Parameters for render_template in Flask
from flask import Flask
app = Flask(__name__)
@app.route("/"):
data = []
data["title"] = "My Page"
data["description"] = "Just a Page"
return render_template("index.html", **data)
# Using **kwargs will do this: render_template("index.html", title="My Page", description="Just a Page")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment