From 62cbf53f7219482ea06e185bc3502fc165c0ca09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nut=CC=A6iu?= Date: Wed, 12 Apr 2017 22:48:23 +0300 Subject: [PATCH] Adding 404 page --- src/application.py | 9 +++++++-- src/templates/404.html | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/templates/404.html diff --git a/src/application.py b/src/application.py index 8de086e..26fa965 100644 --- a/src/application.py +++ b/src/application.py @@ -15,20 +15,25 @@ You should have received a copy of the GNU General Public License along with scoreboard-benchmark . If not, see . """ -from flask import Flask import flask -import requests app = flask.Flask(__name__) + @app.route("/upload") def upload(): return "Upload" + @app.route("/") def index(): return flask.render_template("index.html") + +@app.errorhandler(404) +def page_not_found_error(e): + return flask.render_template("404.html"), 404 + if __name__ == "__main__": app.run("") \ No newline at end of file diff --git a/src/templates/404.html b/src/templates/404.html new file mode 100644 index 0000000..88c7087 --- /dev/null +++ b/src/templates/404.html @@ -0,0 +1,14 @@ + + + + + 404 + + + +

Oopsy poopsy...

+

Page not found! 404

+

Please go away..

+

Leave me alone plz.

+ + \ No newline at end of file