Skip to content

Instantly share code, notes, and snippets.

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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment