forked from CSAILVision/places365
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
25 lines (22 loc) · 822 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from flask import Flask, render_template, request, jsonify
from requete import *
app = Flask(__name__)
@app.route('/')
def index():
if request.method == 'GET':
data = search_init()
return render_template('main.html',data=data)
@app.route('/filtrage_lieu', methods=['GET', 'POST'])
def filtrage_lieu():
if request.method == 'GET':
lieu = request.args.get('lieu')
data = search_lieu(lieu)
return render_template('search_lieu.html', data=data)
@app.route('/filtrage_object', methods=['GET', 'POST'])
def filtrage_object():
if request.method == 'GET':
object = request.args.get('object')
data = search_object(object)
return render_template('search_object.html', data=data)
if __name__ == '__main__':
app.run(debug=True)