Ajout de page d'erreur
This commit is contained in:
parent
92e44f6029
commit
a03f6a94eb
7
app.py
7
app.py
@ -5,8 +5,15 @@ import pages
|
|||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
|
@app.route('/home')
|
||||||
|
@app.route('/home/')
|
||||||
def main():
|
def main():
|
||||||
return pages.main()
|
return pages.main()
|
||||||
|
|
||||||
|
@app.errorhandler(404)
|
||||||
|
def error(e):
|
||||||
|
return pages.error()
|
||||||
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
3
pages.py
3
pages.py
@ -5,3 +5,6 @@ import definitions as lib
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
return render_template("main.html")
|
return render_template("main.html")
|
||||||
|
|
||||||
|
def error():
|
||||||
|
return render_template("error.html")
|
||||||
|
11
templates/error.html
Normal file
11
templates/error.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="/static/style.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Erreur !</h1>
|
||||||
|
<p>Retour à <a href="/home">la page d'accueil</a></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link href="static/style.css" rel="stylesheet" type="text/css" />
|
<link href="/static/style.css" rel="stylesheet" type="text/css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Bienvenue !</h1>
|
<h1>Bienvenue !</h1>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user