Ajout d'une page d'erreur
This commit is contained in:
parent
f4c3aa5d1a
commit
108d066711
15
app.py
15
app.py
@ -175,3 +175,18 @@ def date_select() :
|
||||
context = {"dident_list":dident_list}
|
||||
|
||||
return render_template("date-select.html", **context)
|
||||
|
||||
@app.errorhandler(404)
|
||||
def error(e):
|
||||
"""
|
||||
Affiche la page d'erreur
|
||||
|
||||
Parameters
|
||||
----------
|
||||
None.
|
||||
|
||||
Returns
|
||||
-------
|
||||
flask.render_template
|
||||
"""
|
||||
return render_template("error.html", error="Page non trouvée !")
|
||||
|
17
templates/error.html
Normal file
17
templates/error.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>UniSquat</title>
|
||||
<link rel="stylesheet" type="text/css" href="../static/style.css">
|
||||
<meta name="viewport" content="width=300, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
{% include "base.html" %}
|
||||
<main>
|
||||
<h2>Erreur !</h2>
|
||||
<p>{{ error }}</p>
|
||||
</main>
|
||||
{% include "footer.html" %}
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user