-1

I have Python code writing HTML code to a HTML file. This HTML file receives the code in a variable named load1.

 <div id="load" class="load">
    
      {{ load1 }}
     
 </div>

On the browser, it displays the following:
browser output

Looking at the actual HTML file I see the following: htmlfile output

The brackets < > is showing as &lt; and &gt;, etc

How can I actually see a table and not the HTML code as the final outcome?

Marin Bînzari
  • 5,208
  • 2
  • 26
  • 43
JK Seo
  • 9
  • 3

1 Answers1

0

Flask, by default, protects any HTML in your variables. You need to turn off autoescaping with the {% autoescape xxx %} command.

Here's the instructions:

https://flask.palletsprojects.com/en/2.2.x/templating/

Tim Roberts
  • 48,973
  • 4
  • 21
  • 30