【发布时间】:2019-08-11 04:48:04
【问题描述】:
我是 Flask 的初学者。我想根据前端最终用户的交互(查询)进行数据库调用,而不是静态数据传递(由于大小)。 我在网上找不到任何关于如何进行的例子。我一直在考虑类似的事情:
@app.route("/")
def index():
return render_template('index.html')
@app.before_first_request
def initialize_database():
pass
@app.route('api/data')
def get_data_by_selecting_bounding_box():
pass
数据是推文,用户应该能够在地图上选择一个区域(边界框)并返回从该区域中包含的数据的 Mongodb 数据库检索到的响应。
【问题讨论】:
标签: python mongodb flask dynamic frontend