Skip to content

Commit

Permalink
Add default 404 error page. (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcantelon committed Sep 8, 2023
1 parent a315d91 commit f72d8fb
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

Check warning on line 39 in AIPscan/__init__.py

View check run for this annotation

Codecov / codecov/patch

AIPscan/__init__.py#L39

Added line #L39 was not covered by tests

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 f72d8fb

Please sign in to comment.