【发布时间】:2018-03-07 21:10:25
【问题描述】:
我目前正在使用Django 开发一个统计门户网站,我正在尝试在我的模板中显示Dataframe 并使用下一个代码:
查看.py:
def tabla(request):
engine = create_engine('postgresql://postgres:alphabeta@localhost:5432/escaladas')
t='escalado 08/2017'
sqltable = ps.read_sql_table(t,engine)
sqltablehead = sqltable.head(n=10)
table = sqltablehead.to_html(classes='table',index=False,escape=False)
return render(request,'escalamiento.html',{'table':table})
我尝试在模板上显示带有for 的表格,但没有显示任何内容并写了{{table}},但给了我这个https://ibb.co/bVpWw5
有什么想法吗?
【问题讨论】:
标签: python django pandas templates bootstrap-4