Timeline for Jinja2 template rendering getting empty string
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 10, 2018 at 20:02 | vote | accept | Swapnil | ||
| Mar 10, 2018 at 19:57 | history | edited | Martijn Pieters | CC BY-SA 3.0 |
added 24 characters in body
|
| Mar 10, 2018 at 19:55 | answer | added | Martijn Pieters | timeline score: 2 | |
| Mar 10, 2018 at 19:54 | comment | added | Martijn Pieters | You are also using fancy, curly quotes, don't do that. Your browser has added proper ASCII quotes. | |
| Mar 10, 2018 at 19:53 | history | edited | Martijn Pieters | CC BY-SA 3.0 |
added 242 characters in body
|
| Mar 10, 2018 at 19:50 | comment | added | Swapnil | @MartijnPieters: I am getting the empty string on the browser screen. The snippet of the HTML page is <html><head></head><body><ul id=""messages""> <li> <div class=""text""> <a></a> </div> </li> .... Yes, the print(python_message) displays the server response as mentioned above. | |
| Mar 10, 2018 at 19:46 | comment | added | Martijn Pieters |
Given that messages is a dictionary, the for message in messages loop will only produce the single 'messages' key from the dictionary. Did you mean to use python_message['messages'] instead?
|
|
| Mar 10, 2018 at 19:45 | comment | added | Martijn Pieters |
Can you give us the output that is produced? Do you get Messages not available instead? Does the print(python_message) line produce output on your console where Flask is running?
|
|
| Mar 10, 2018 at 19:43 | comment | added | Martijn Pieters |
The u prefix is a type indicator, you have Unicode strings. This is normal and expected when decoding JSON data. They are not the problem.
|
|
| Mar 10, 2018 at 19:42 | comment | added | JacobIRR | check out this answer | |
| Mar 10, 2018 at 19:34 | history | asked | Swapnil | CC BY-SA 3.0 |