service firewalld status
#if Firewalld not running
service firewalld start
firewall-cmd --zone=public --permanent --add-port=5000/tcp
firewall-cmd --zone=public --list-all

cd <flask_rootdir>
pyenv activate
pip install flask

vi test.py

from flask import Flask
app = Flask(__name__)

@app.route("/")
def index():
     return "It's Flask!"

@app.route("/<name>")
def hello(name):
     return "Hello, %s. :)" %name

if __name__ == "__main__":
    app.run(host='0.0.0.0')
python test.py
#open web browser with http://<ip>:5000

===

@app.route('<path>', options)
add_url_rule('<path>, '<name>', func)

@app.route("/xxx/") -> <url>/xxx == <url>/xxx/
@app.route("/xxx") -> <url>/xxx/ -> 404 Not Found

@app
.route('/<name>')
@app
.route('/<path/<int:var>') #type(var) == type(int)
@app
.route('/hello/<float:var>') #type(var) == type(float)

app.run(host, port, debug, options)

url_for():
@app
.route('/admin')

def
hello_admin():

   
return 'Hello Admin'


@app
.route('/guest/<guest>')

def
hello_guest(guest):

   
return 'Hello
Guest, %s.' % guest

@app.route('/user/<name>')
def
hello(name):
   
if name =='admin':
       
return redirect(url_for('hello_admin'))
   
else:
       
return redirect(url_for('hello_guest', guest = name))