Add 404 default error handler.

This handles HTTP 404 page does not exist errors.
multi-ogserver
Roberto Hueso Gómez 2020-09-04 13:20:11 +02:00
parent bb7e201991
commit 31d2808a43
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block content %}
<h1>
{{ _('Error!') }}: {{ message }}
</h1>
{% endblock %}

View File

@ -15,6 +15,10 @@ def load_config():
g.server = OGServer()
g.server.load_config('ogcp/cfg/ogserver.json')
@app.errorhandler(404)
def page_not_found(error):
return render_template('error.html', message=error), 404
@app.route('/')
def index():
return render_template('base.html')