Adding 404 page
This commit is contained in:
parent
31bf015500
commit
62cbf53f72
2 changed files with 21 additions and 2 deletions
|
@ -15,20 +15,25 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with scoreboard-benchmark . If not, see <http://www.gnu.org/licenses/>.
|
along with scoreboard-benchmark . If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
from flask import Flask
|
|
||||||
import flask
|
import flask
|
||||||
import requests
|
|
||||||
|
|
||||||
|
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/upload")
|
@app.route("/upload")
|
||||||
def upload():
|
def upload():
|
||||||
return "Upload"
|
return "Upload"
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
return flask.render_template("index.html")
|
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__":
|
if __name__ == "__main__":
|
||||||
app.run("")
|
app.run("")
|
14
src/templates/404.html
Normal file
14
src/templates/404.html
Normal 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>
|
Loading…
Reference in a new issue