Python Forum
how to create dynamic arguments to be passed in jinja template in url_for function? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: how to create dynamic arguments to be passed in jinja template in url_for function? (/thread-26438.html)



how to create dynamic arguments to be passed in jinja template in url_for function? - experimental - May-01-2020

I am creating an online player and here I have a search box which returns songs from a databases that matches the search string searched https://prnt.sc/s9avwl . Each line is clickable and each contains info about the artist name, album name, and song name.

What I want to do now is, that after clicking it will redirect me to specific url like this .../artistname/albumname/titlename where artistname albumname titlename will be different based on what was clicked. So if i click the first one it should be steveroach/possibleplanet/firstmurmer second should be steveroach/possibleplanet/cellmemory etc..

But i dont now how to create these dynamic arguments to be passed in jinja template in url_for function. Do I need to use some sort of javascript or is there any pure flask way which i should know about? I believe this should be pretty straightofroward ..Here is the code in themplate https://prnt.sc/s9awuf


RE: how to create dynamic arguments to be passed in jinja template in url_for function? - Larz60+ - May-01-2020

post code on forum using code tags