Linked Questions

38 votes
1 answer
71k views

I have some data in jinja2 like this 'item1|item2|item3' And I want to turn it into rendered linebreaks. However, when I replace it with br/ tags, I get the br tags rendered on the page. So {{ '...
mcpeterson's user avatar
  • 5,154
23 votes
2 answers
29k views

I'm using Flask in an app that render some data from a sqlite database. My problem is when the app render some text that has html inside, appear as text instead of html. For example, the record in ...
jaloplo's user avatar
  • 951
21 votes
1 answer
23k views

I'm building a web page to show articles. In my database, I have to attributes, one of which is used to put Markdown code and the other to save HTML code converted from the Markdown code. I want to ...
jinglei's user avatar
  • 3,403
4 votes
1 answer
10k views

I am using Flask ,Jinja2 template(html file) to post the panda dataframe tables which are stored in results in ABC.py. Table looks like :Image I am using dictionary to print it but it is not coming ...
Naomi's user avatar
  • 67
11 votes
2 answers
21k views

I am following a Flask tutorial where he is using " | safe " in jinja2 template. Why do we need this pipe symbol and safe? without using safe it prints all html tags. By using | safe, it shows ...
Muhammad Arslan Maqsood's user avatar
7 votes
1 answer
10k views

I have some HTML content that I want to pass to the template to render. However, it escapes the tags to use HTML entities (<), so they show up as code rather than markup. How can I render ...
OMG coder's user avatar
  • 159
4 votes
2 answers
21k views

I am using Flask render_template method to render my html page as below: render_template('index.html', content="<div>Hello World!</div>") My index.html is: <html lang="en&...
Awesome's user avatar
  • 6,807
3 votes
2 answers
12k views

So I want to put an svg file into my page(not as an image, as an xml element) - need it like this so I could dynamically change elements within the page. and I made a simple code that I thought it'...
sol-invictii's user avatar
3 votes
2 answers
4k views

Currently I have this code boldtext = "<b>I'm bolded!<b>" @app.route('/') def index(): return render_template("index.html", boldtext=boldtext) and then in my index.html, I have a ...
Oscar W's user avatar
  • 484
2 votes
1 answer
8k views

I am just playing with python script (test.py) there is one function test1(). def test1(): return '<button (code ... for one simple button) .... ></button>' In my init.py: from ...
Testing man's user avatar
3 votes
1 answer
3k views

So in Jinja2 I have this code: <div id='posts'> <!-- Display all posts --> {% for p in posts %} <div class='post'> <h3>{{ p[1] }}</h3> ...
starscape's user avatar
  • 3,053
-1 votes
1 answer
3k views

I am using Flask as the backend and reading a piece of text from a file that contains newlines as \n. I wish to render this text inside a div. To do so, I am replacing the \n with <br> and then ...
Chaitanya Shivade's user avatar
-1 votes
2 answers
4k views

I have a variable in my python flask application, which contains html data html_data='<p> this data to be displayed </p>' I have passed this variable in render_template(temp.html,data=...
Avinash Daipule's user avatar
0 votes
1 answer
2k views

I am seeing a strange issue when I attempt to write some data to a HTML table, using Flask. When the page loads, it is printing the data into a single long string as below: <table class="table ...
JohnL_10's user avatar
  • 569
0 votes
4 answers
2k views

How can I make newlines become normal and display in the right way?
Allen's user avatar
  • 165

15 30 50 per page
1
2 3 4 5 6