diff options
author | 2017-07-26 21:10:12 +1000 | |
---|---|---|
committer | 2017-07-26 21:15:43 +1000 | |
commit | 5507e58fc4c5acf0642fd59cb226d01a4d70b610 (patch) | |
tree | 9377a2f92dae2e3f1237b32e186302411ef19b1c /backend | |
parent | gitignore: ignore grumpy database (diff) | |
download | grumpy-5507e58fc4c5acf0642fd59cb226d01a4d70b610.tar.gz grumpy-5507e58fc4c5acf0642fd59cb226d01a4d70b610.tar.bz2 grumpy-5507e58fc4c5acf0642fd59cb226d01a4d70b610.zip |
Add 404 error handling.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/__init__.py b/backend/__init__.py index f8bfd6a..f9b859a 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -1,4 +1,4 @@ -from flask import Flask +from flask import render_template, Flask from flask_sqlalchemy import SQLAlchemy app = Flask("frontend") # FIXME: Finish rearranging frontend/backend modules properly instead of pretending to be frontend in backend/__init__ because jinja templates are looked for from <what_is_passed_here>/templates @@ -13,3 +13,7 @@ GrumpyView.register(app) SetupView.register(app) __all__ = ["app", "db"] + +@app.errorhandler(404) +def not_found(error): + return render_template('404.html'), 404 |