Created
May 31, 2022 10:38
-
-
Save tutecode/c902ed5bb3702ef881d0a60a935d91a4 to your computer and use it in GitHub Desktop.
web page with python flask
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, 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