Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from flask import Flask, render_template
app = Flask(__name__)
def gen_page(page):
def endpoint():
return render_template(page, page_name=page)
endpoint.__name__ = page
app.route("/" + page)(endpoint)
pages = ["index", "about", "contact"]
for page in pages:
gen_page(page)
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.