FLASK_APP=app.py FLASK_DEBUG=1 flask run

examples/flask/12/app.py
from flask import Flask
app = Flask(__name__)

@app.route("/")
def main():
    return '''
Main
<a href="/not">404 page</a>
'''

# @app.errorhandler(404)
# def not_found(e):
#     return "Our Page not found", 404

curl -I http://localhost:5000/not

HTTP/1.0 404 NOT FOUND