Fait de la merde sur app.py...

This commit is contained in:
Antoine Waehren 2021-12-03 02:17:53 +01:00
parent 4c550380b6
commit c4986d6aef
4 changed files with 45 additions and 9 deletions

21
app.py
View File

@ -4,12 +4,15 @@ import pages
app = Flask(__name__)
@app.route('/')
@app.route('/home')
@app.route('/home/')
@app.route('/', methods=['GET', 'POST'])
@app.route('/home', methods=['GET', 'POST'])
@app.route('/home/', methods=['GET', 'POST'])
def main():
return pages.main()
if request.method == 'GET':
print(request)
else:
return pages.main()
@app.route('/sauveteurs/<int:idsauveteur>')
def sauveteur(idsauveteur):
return pages.sauveteur(idsauveteur)
@ -19,5 +22,13 @@ def error(e):
return pages.error()
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'POST':
return do_the_login()
else:
return show_the_login_form()
if __name__=="__main__":
app.run(debug=True)

View File

@ -1,11 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<link href="/static/style.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<title>404 Not Found - Sauveuteurs du dunkerquois</title>
<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>
<header id="banner">
<img src="../static/icon.png" width="150" height="75">
<span id="logo_title">Sauveuteurs du dunkerquois</span>
</header>
<h1>Page introuvable !</h1>
<p>Retour à <a href="/home">la page d'accueil</a>.</p>
</body>
</html>

View File

@ -14,7 +14,7 @@ description
<meta charset="utf-8">
<title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title>
<link href="../static/style.css" rel="stylesheet" type="text/css" />
</head>
</head>
<body>
<header id="banner">
<img src="../static/icon.png" width="150" height="75">

19
templates/search.html Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>{{nom}} {{prenom}} - Sauveuteurs du dunkerquois</title>
<link href="../static/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<header id="banner">
<img src="../static/icon.png" width="150" height="75">
<span id="logo_title">Sauveuteurs du dunkerquois</span>
</header>
<br>
<form class="searchbar" method=get>
<input type="text" placeholder="Saisissez votre recherche..." size=20>
<input type="submit" value="Rechercher">
</form>
<table
</body>
</html>