summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-04 13:20:11 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-04 13:20:11 +0200
commit31d2808a43f25052b4ee8ff7404f627439a28026 (patch)
treeff950dec41bd00b39342b804ebe98ca11d0564ed /ogcp/views.py
parentbb7e20199124b84de5d252ffe0371a5799feee42 (diff)
Add 404 default error handler.
This handles HTTP 404 page does not exist errors.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 0772e33..1621455 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -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')