Answers for "how to create routes in flask"

0

how to create routes in flask

from flask import Flask
app = Flask(__name__)

@app.route("/")
def index():
    # This will return Hello World in an h1 tag when you go to localhost:5000
    return '<h1>Hello World</h1>'
@app.route("/signup")
def sign_up():
    # This will return Sign Up in an h1 tag when you go to localhost:5000
    return '<h1>Sign Up</h1>'
  
app.run(debug=True)
Posted by: Guest on October-29-2021

Code answers related to "how to create routes in flask"

Python Answers by Framework

Browse Popular Code Answers by Language