From b570e2a54c1beb304dfbe2537b41661cc2a36112 Mon Sep 17 00:00:00 2001 From: Satyam Singh <150139543+SatyamSingh8306@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:18:43 +0530 Subject: [PATCH] commiting --- app.py | 5 ++++ templates/error_404.html | 62 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 templates/error_404.html diff --git a/app.py b/app.py index 81034ee..600a2cb 100644 --- a/app.py +++ b/app.py @@ -188,6 +188,11 @@ def format_response(response_text): def index(): return render_template('index.html') +"""Adding 404 error handler page """ +@app.errorhandler(404) +def error404(e): + return render_template("error_404.html") + @app.route('/api/weather') def get_weather(): diff --git a/templates/error_404.html b/templates/error_404.html new file mode 100644 index 0000000..2342365 --- /dev/null +++ b/templates/error_404.html @@ -0,0 +1,62 @@ + + +
+ + +The page you're looking for seems to have drifted into cyberspace.
+ + +