首先,我使用的是:python3,Flask,PostgreSQL,一个引导主题。在
我有一张近34000个值的表。问题是,页面加载速度非常慢,原因是数值太多。如何使用Python和Flask的服务器端处理(或其他)来提高性能?在
这是我的一部分主.py公司名称:
@login_required
def home():
connect() # Connect to the PG database
connect.cur.execute("""SELECT * FROM test""")
test_execute = connect.cur.fetchall()
count_equipement()
return render_template('index.html',
value=test_execute,
value2=count_equipement.nb_equipement,
value3=check_ok.nb_ok,
value4=check_ko.nb_ko)
test_execute获取我的表的所有值。在我的索引.html以下是我如何显示数据:
^{pr2}$在我的引导主题中,有一个.js来正确地对表进行分页。以下是8个值的结果:
如何进行服务器端处理?我已经检查了this link,但我不认为我可以把这个应用到我的案例中。。。在
这是我问题的答案。(评论用法语)
相关问题 更多 >
编程相关推荐