Add custom error pages
This commit is contained in:
parent
bec6b19d1c
commit
4f5013460f
|
@ -0,0 +1,12 @@
|
|||
from flask import render_template
|
||||
from app import app
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def not_found_error(error):
|
||||
return render_template("404.html"), 404
|
||||
|
||||
|
||||
@app.errorhandler(500)
|
||||
def internal_error(error):
|
||||
return render_template("500.html"), 500
|
|
@ -0,0 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block app_content %}
|
||||
<h1>Sorry, we couldn't find that</h1>
|
||||
<p><a href="{{ url_for('index') }}">Back</a></p>
|
||||
{% endblock %}
|
|
@ -0,0 +1,8 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block app_content %}
|
||||
<h1>An unexpected error has occurred</h1>
|
||||
<p>The administrator has been notified!</p>
|
||||
<p>If he gets too many notifications, we might replace him with an AI</p>
|
||||
<p><a href="{{ url_for('index') }}">Back</a></p>
|
||||
{% endblock %}
|
|
@ -0,0 +1,9 @@
|
|||
{% extends "base.html" %}
|
||||
{% import 'bootstrap/wtf.html' as wtf %}
|
||||
|
||||
{% block app_content %}
|
||||
<h1>Dataset visualization</h1>
|
||||
<img src="data:image/png;base64,{{ plot }}" alt="Image Placeholder">
|
||||
<img src="data:image/png;base64,{{ map }}" alt="Image Placeholder">
|
||||
<p><a href="{{ url_for('data') }}">Back</a></p>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue