add custom 404 page
This commit is contained in:
@@ -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
|
||||
|
||||
8
app/templates/common/404.html
Normal file
8
app/templates/common/404.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}not found{% endblock %}
|
||||
{% block content %}
|
||||
<div class="darkbg settings-container">
|
||||
<h1 class="thread-title">404 Not Found</h1>
|
||||
<p>The requested URL does not exist.</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user