Python Forum
how to create dynamic arguments to be passed in jinja template in url_for function?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to create dynamic arguments to be passed in jinja template in url_for function?
#1
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
Reply
#2
post code on forum using code tags
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Solved] Browser won't parse text from yaml loaded into Jinja SpongeB0B 1 952 Jul-07-2022, 09:37 PM
Last Post: SpongeB0B
Question Accessing a value of a dictionary with jinja.... SpongeB0B 2 10,323 Aug-06-2021, 09:05 AM
Last Post: ndc85430
  how to pass javascript variables to url_for function in a flask template experimental 5 6,290 Oct-29-2020, 03:29 AM
Last Post: universe
  Jinja sort values from request.form SpongeB0B 2 2,184 Jul-26-2020, 07:41 AM
Last Post: SpongeB0B
  Flask Create global response function to be called from every where in the web app umen 2 2,255 Apr-14-2020, 09:54 PM
Last Post: umen
  Problem with arguments in route function. darktitan 2 2,956 Aug-26-2019, 04:55 PM
Last Post: snippsat
  Flask tutorial errors in jinja, auth undefined Ecniv 2 2,451 May-03-2019, 02:04 PM
Last Post: Ecniv
  flask sqlite jinja accessing and updating database help pascale 5 4,080 Feb-11-2019, 03:49 PM
Last Post: pascale
  display multiple sensors on webpage python flask jinja pascale 6 5,191 Jan-29-2019, 10:10 AM
Last Post: pascale
  How to create dynamic webscraper in Django using BeautifulSoup Prince_Bhatia 1 6,117 Jan-26-2018, 02:07 PM
Last Post: frostbite

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020