aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-19 16:21:21 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-19 16:21:21 +0200
commitcfecca9b9a7dd7714e2aa6e6d6a483466fe5b51b (patch)
treee15346e70ed92cb43938ae808826bfbb9cd4df77 /pyaggr3g470r/views.py
parentChanged a little bit the style of the title. (diff)
downloadnewspipe-cfecca9b9a7dd7714e2aa6e6d6a483466fe5b51b.tar.gz
newspipe-cfecca9b9a7dd7714e2aa6e6d6a483466fe5b51b.tar.bz2
newspipe-cfecca9b9a7dd7714e2aa6e6d6a483466fe5b51b.zip
Added custom error pages.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index e526001b..c1fa459e 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -94,6 +94,19 @@ def load_user(email):
# Return an instance of the User model
return User.query.filter(User.email == email).first()
+
+#
+# Custom error pages.
+#
+@app.errorhandler(404)
+def page_not_found(e):
+ return render_template('errors/404.html'), 404
+
+@app.errorhandler(500)
+def page_not_found(e):
+ return render_template('errors/500.html'), 500
+
+
def redirect_url(default='home'):
return request.args.get('next') or \
request.referrer or \
bgstack15