|
Hope it is ok to post this question here, happy to be pointed to a more relevant thread if need be. I am building a small website using Flask and in one HTML page I need to include javascript files depending on the report type selected by the user. This is my code using Jinja2 (using images because SA was blocking me posting the code): https://imageupload.io/kKoVPz0GQPPzZ7D The resulting HTML code is https://imageupload.io/zh4Y2WMLelxIqkl I believe the code does not work because I am nesting the "{{ }}" (once around the url_for function and once around the jsFilename). Is this the issue? If this is the issue, how do I deal with it?
|
# ¿ Oct 19, 2023 15:21 |
|
|
# ¿ Apr 29, 2024 12:59 |
|
minato posted:Try: Both versions worked! Do you mind pointing me to some documentation or tell me what keyword to use to find the ~ as what to use? EDIT: I found it here: https://jinja.palletsprojects.com/en/3.1.x/templates/ under the "Other Operators". I definitely missed that when I was looking through the documentation. I also ended up finding this solution which would have worked for my use case: https://stackoverflow.com/a/19511353/3130499 Jose Cuervo fucked around with this message at 16:40 on Oct 19, 2023 |
# ¿ Oct 19, 2023 16:37 |
|
Mistaken post.
|
# ¿ Oct 19, 2023 16:39 |