35 lines
746 B
Python
35 lines
746 B
Python
# Fichier principal
|
|
from flask import Flask, escape, request, url_for
|
|
import pages
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route('/', methods=['GET', 'POST'])
|
|
@app.route('/home', methods=['GET', 'POST'])
|
|
@app.route('/home/', methods=['GET', 'POST'])
|
|
def main():
|
|
if request.method == 'GET':
|
|
print(request)
|
|
else:
|
|
return pages.main()
|
|
|
|
@app.route('/sauveteurs/<int:idsauveteur>')
|
|
def sauveteur(idsauveteur):
|
|
return pages.sauveteur(idsauveteur)
|
|
|
|
@app.errorhandler(404)
|
|
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)
|