Writing an error handler

Report a typo

Let's say you have two HTML pages for handling 404 and 403 errors: 404.html and 403.html. Please, write two error handlers: the first one should return 404.html for 404, and the second — 403.html for 403.

Please, call the handler functions page_not_found and forbidden respectively.

Write a program in Python 3
from flask import Flask, render_template

app = Flask(__name__)

@app.errorhandler(404)
# your code

@app.errorhandler(403)
# your code
___

Create a free account to access the full topic