ソースを参照

Add custom 404.

master
Ben Kurtovic 7年前
コミット
52ffd35abc
2個のファイルの変更10行の追加0行の削除
  1. +4
    -0
      app.py
  2. +6
    -0
      templates/404.mako

+ 4
- 0
app.py ファイルの表示

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

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

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

+ 6
- 0
templates/404.mako ファイルの表示

@@ -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>

読み込み中…
キャンセル
保存