This commit is contained in:
2025-06-21 02:26:24 +01:00
parent 4a577e928a
commit 189d63d7ba
7 changed files with 132 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
from flask import Flask, request, render_template, send_from_directory
from flask import Flask, request, render_template, send_from_directory, abort
from flask_session import Session
from dotenv import load_dotenv
from os import getenv as env
@@ -29,7 +29,6 @@ db = database.Database(db_name=env('DB_NAME', default='db.sqlite'))
@app.route('/')
def index():
logging.info("Rendering index page")
return render_template('index.html')
@@ -43,6 +42,14 @@ def web_stuffs():
)
@app.route('/<path:path>')
def catch_all(path):
try:
return render_template(path + '.html')
except Exception as e:
abort(404)
@app.route('/404')
@app.errorhandler(404)
def not_found():