webapp
This commit is contained in:
parent
71229491f7
commit
768418258e
1 changed files with 6 additions and 12 deletions
18
webapp.py
18
webapp.py
|
@ -30,12 +30,6 @@ app = Flask(__name__)
|
||||||
def get_form():
|
def get_form():
|
||||||
return render_template("landing_form.html")
|
return render_template("landing_form.html")
|
||||||
|
|
||||||
@app.route("/result", methods=['POST'])
|
|
||||||
def show_result():
|
|
||||||
pto = escape(request.form['pto'])
|
|
||||||
result = parse_response(query_axione_pto(cfg, pto))
|
|
||||||
return render_template("result.html", pto=pto, result=result)
|
|
||||||
|
|
||||||
@app.route("/addresses/communes", methods=['GET'])
|
@app.route("/addresses/communes", methods=['GET'])
|
||||||
def get_communes():
|
def get_communes():
|
||||||
to_search=request.args.get('s')
|
to_search=request.args.get('s')
|
||||||
|
@ -58,15 +52,15 @@ def get_fantoir_voies(codeInsee):
|
||||||
|
|
||||||
@app.route("/test/address", methods=['POST'])
|
@app.route("/test/address", methods=['POST'])
|
||||||
def test_address():
|
def test_address():
|
||||||
print(request.form)
|
commune = escape(request.form['commune'])
|
||||||
# pto = escape(request.form['pto'])
|
numeroVoie = escape(request.form['numeroVoie'])
|
||||||
|
voie = escape(request.form['voie'])
|
||||||
# result = parse_response(query_axione_pto(cfg, pto))
|
# result = parse_response(query_axione_pto(cfg, pto))
|
||||||
return json.dumps({'success':True}), 200, {'ContentType':'application/json'}
|
return json.dumps({'success':True}), 200, {'ContentType':'application/json'}
|
||||||
|
|
||||||
|
|
||||||
@app.route("/test/pto", methods=['POST'])
|
@app.route("/test/pto", methods=['POST'])
|
||||||
def test_pto():
|
def test_pto():
|
||||||
print(request.form)
|
pto = escape(request.form['pto'])
|
||||||
# pto = escape(request.form['pto'])
|
result = parse_response(query_axione_pto(cfg, pto))
|
||||||
# result = parse_response(query_axione_pto(cfg, pto))
|
return render_template("result.html", pto=pto, result=result)
|
||||||
return json.dumps({'success':True}), 200, {'ContentType':'application/json'}
|
|
||||||
|
|
Loading…
Reference in a new issue