Skip to content

Commit

Permalink
Add default 404 error page. (#66) (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcantelon authored Sep 13, 2023
1 parent 62b8ca7 commit 3ea0959
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion AIPscan/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

from flask import Flask
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy

from AIPscan.celery import configure_celery
Expand Down Expand Up @@ -34,4 +34,8 @@ def create_app(config_name="default"):

db.create_all()

@app.errorhandler(404)
def page_not_found(e):
return render_template("error/404.html"), 404

return app
14 changes: 14 additions & 0 deletions AIPscan/templates/error/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base.html" %}

{% block content %}

<div class="row">
<div class="col-md-12 d-flex flex-column justify-content-center align-items-center vh-100">
<h1>404</h1>
<h4>Page not found</h4>
<p>The page you are looking for does not exist.</p>
<a href="{{ url_for('aggregator.ss_default') }}">Back To Home</a>
</div>
</div>

{% endblock %}

0 comments on commit 3ea0959

Please sign in to comment.