Browse Source

Add custom 404.

master
Ben Kurtovic 7 years ago
parent
commit
52ffd35abc
2 changed files with 10 additions and 0 deletions
  1. +4
    -0
      app.py
  2. +6
    -0
      templates/404.mako

+ 4
- 0
app.py View File

@@ -84,5 +84,9 @@ def set_style(style):
abort(404) abort(404)
return "", 204 return "", 204


@app.errorhandler(404)
def page_not_found(err):
return render_template("404.mako"), 404

if __name__ == "__main__": if __name__ == "__main__":
app.run(debug=True, port=8080) app.run(debug=True, port=8080)

+ 6
- 0
templates/404.mako View File

@@ -0,0 +1,6 @@
<%inherit file="_base.mako"/>
<%block name="title">
404 &ndash; ${g.config.get("corp.name") | h}
</%block>
<h1>Error 404</h1>
<p>The page you asked for couldn't be found.</p>

Loading…
Cancel
Save