Adding 404 page

This commit is contained in:
Denis-Cosmin Nutiu 2017-04-12 22:48:23 +03:00
parent 31bf015500
commit 62cbf53f72
2 changed files with 21 additions and 2 deletions

View file

@ -15,20 +15,25 @@
You should have received a copy of the GNU General Public License
along with scoreboard-benchmark . If not, see <http://www.gnu.org/licenses/>.
"""
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("")

14
src/templates/404.html Normal file
View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>404</title>
</head>
<!-- May god forgive me for this mistake. -->
<body style="text-align: center">
<h1>Oopsy poopsy...</h1>
<h2>Page not found! 404</h2>
<h3>Please go away..</h3>
<h4>Leave me alone plz.</h4>
</body>
</html>