commit e5a1478fceb3b5e2f72fee32c070db0be9560807
parent 444f50547dcc86bc7b72323c6a8d59219aba285c
Author: ashermorgan <59518073+ashermorgan@users.noreply.github.com>
Date: Sun, 3 Mar 2024 16:45:30 -0800
Add 404 page
Diffstat:
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/songs2slides/__init__.py b/songs2slides/__init__.py
@@ -1,9 +1,13 @@
-from flask import Flask
+from flask import Flask, render_template
+
+def error_404(e):
+ return render_template('error.html', message='404 Not Found'), 404
def create_app():
app = Flask(__name__)
from . import routes
app.register_blueprint(routes.bp)
+ app.register_error_handler(404, error_404)
return app
diff --git a/songs2slides/static/global.css b/songs2slides/static/global.css
@@ -25,6 +25,9 @@ main {
margin: auto;
max-width: 500px;
}
+h1 {
+ text-align: center;
+}
p {
line-height: 1.4;
margin-bottom: 1rem;
diff --git a/songs2slides/templates/error.html b/songs2slides/templates/error.html
@@ -0,0 +1,5 @@
+{% extends "layout.html" %}
+
+{% block main %}
+<h1>{{ message }}</h1>
+{% endblock main %}