Using Dash with Jinja2


does anyone have experience in using a Jinja2 template to render a pandas dataframe in dash?
I am new to templating and would appreciate if someone could help.

Hello @subodhpokhrel7,

Why are you trying to render a dataframe using jinja2? This is for use with flask templates, while you can do this by making an endpoint for the flask server to render it with no issues.

There are other things that you can use to display a dataframe, specifically dash AG grid and dash datatable. Both of which are just components inside the dash eco system.

Hi @jinnyzor ,

I want to create a button to download the webpage as a .html. Since that is not possible in conventional dash, I am trying to implement a Jinja2 template to be able to do so.

You’ll need to use df to_html and send that to the template.

1 Like