Created
May 30, 2015 16:41
-
-
Save Lothiraldan/87bf5fc9fba604ececa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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