Answers for "flask export routes"

1

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
0

export flask app

> set FLASK_APP=hello
> flask run
Posted by: Guest on August-14-2020

Python Answers by Framework

Browse Popular Code Answers by Language