From d41e540d1fb5c445a15d27ab67cacd99ee3846ba Mon Sep 17 00:00:00 2001 From: starnakin Date: Fri, 9 Jun 2023 16:27:12 +0200 Subject: [PATCH] add: page not found redirect to / --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index c2b7658..6ce3f3d 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,10 @@ import home, login, panel, register, logout app = flask.Flask(__name__) app.secret_key = config.secret +@app.errorhandler(404) +def not_found(e): + return (flask.redirect("/")) + if (__name__ == "__main__"): app.register_blueprint(home.page) app.register_blueprint(login.page)