Custom 404 Page Flask

[Solved] Custom 404 Page Flask | Python Frameworks Flask - Code Explorer | www.yomemimo.com
Question : custom 404 page flask

Answered by : andyishereboi

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 : https://flask.palletsprojects.com/en/1.1.x/patterns/errorpages/ | Last Update : Sat, 23 Apr 22

Question : flask return 404

Answered by : santosh-pal

I had the same issue. I had it because I changed the parameters SERVER_NAMEof the config to a name which is not the name of the server.
You can solve this bug by removing SERVER_NAME from the config if you have it.

Source : | Last Update : Sat, 27 Mar 21

Answers related to custom 404 page flask

Code Explorer Popular Question For Python Frameworks Flask