add custom 404 page

This commit is contained in:
2025-12-03 06:37:57 +03:00
parent 24fe0aba30
commit 7c037d1593
2 changed files with 10 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
from flask import Flask, session, request
from flask import Flask, session, request, render_template
from dotenv import load_dotenv
from .models import Avatars, Users, PostHistory, Posts, MOTD
from .auth import digest
@@ -227,7 +227,7 @@ def create_app():
elif request.path.startswith('/api/'):
return {'error': 'not found'}, e.code
else:
return e
return render_template('common/404.html'), e.code
# this only happens at build time but
# build time is when updates are done anyway