Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

custom 404 page flask

from flask import render_template

@app.errorhandler(404)
def page_not_found(e): # e must be in there
    # note that we set the 404 status, this is what it catches
    return render_template('404.html'), 404
Source by flask.palletsprojects.com #
 
PREVIOUS NEXT
Tagged: #custom #page #flask
ADD COMMENT
Topic
Name
9+9 =