add: page not found redirect to /

This commit is contained in:
starnakin 2023-06-09 16:27:12 +02:00
parent 161a7ff5b3
commit d41e540d1f

View File

@ -6,6 +6,10 @@ import home, login, panel, register, logout
app = flask.Flask(__name__) app = flask.Flask(__name__)
app.secret_key = config.secret app.secret_key = config.secret
@app.errorhandler(404)
def not_found(e):
return (flask.redirect("/"))
if (__name__ == "__main__"): if (__name__ == "__main__"):
app.register_blueprint(home.page) app.register_blueprint(home.page)
app.register_blueprint(login.page) app.register_blueprint(login.page)