Skip to content

Instantly share code, notes, and snippets.

@tutecode
Created May 31, 2022 10:38
Show Gist options
  • Save tutecode/c902ed5bb3702ef881d0a60a935d91a4 to your computer and use it in GitHub Desktop.
Save tutecode/c902ed5bb3702ef881d0a60a935d91a4 to your computer and use it in GitHub Desktop.
web page with python flask
from flask import Flask, render_template, url_for
#instantiate the flask app
app= Flask(__name__)
#create each of the routes. The home page route
@app.route("/")
@app.route("/home")
def home():
return render_template('home.html')
#about page route
@app.route("/about")
def about():
return render_template('about.html')
#portfolio page route
@app.route("/portfolio", methods= ['GET', 'POST'])
def portfolio():
return render_template('portfolio.html')
#contact me page route
@app.route("/contact")
def contact():
return render_template('contact.html')
if __name__=="__main__":
app.run(debug= True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment