Ver a proveniência

Add custom 404.

master
Ben Kurtovic há 7 anos
ascendente
cometimento
52ffd35abc
2 ficheiros alterados com 10 adições e 0 eliminações
  1. +4
    -0
      app.py
  2. +6
    -0
      templates/404.mako

+ 4
- 0
app.py Ver ficheiro

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

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

Carregando…
Cancelar
Guardar