Django Sb Admin 2 Pandas

1

I'm doing a statistical portal, with Django and for the calculations I want to use Pandas, I'm trying to show some tables in the following way:

Views.py

def tabla(request):
    engine = create_engine('postgresql://postgres:xxxx@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})

I am using Bootstrap Sb Admin 2 for the graphical interface and I would like to show that table with the look that Sb Admin 2 gives me but I have no idea how to do it, I tried to write {{table}} but it shows me the following without the table format:

And I also tried it with a for , but it does not show me anything (it's worth noting that I can be doing it wrong, I'm new with Django and Bootstrap). Any idea how to do it?

    
asked by Anthony 26.09.2017 в 15:23
source

1 answer

1

I already found the solution. It should be placed as follows {{table|safe}} . so that the HTML is not Escape

    
answered by 26.09.2017 / 18:08
source