Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default 404 error page. (#66) #208

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %}