diff --git a/AIPscan/__init__.py b/AIPscan/__init__.py index 1c00919f..10af21ed 100644 --- a/AIPscan/__init__.py +++ b/AIPscan/__init__.py @@ -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 @@ -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 diff --git a/AIPscan/templates/error/404.html b/AIPscan/templates/error/404.html new file mode 100644 index 00000000..0027d37d --- /dev/null +++ b/AIPscan/templates/error/404.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

404

+

Page not found

+

The page you are looking for does not exist.

+ Back To Home +
+
+ +{% endblock %}