Flask custom 404 page



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

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

examples/flask/404/app404.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