Skip to content
Advertisement

Pass dynamic url parameter for flask url_for

I have the below URL’s mapping to one form:

JavaScript

How do I pass

JavaScript

dynamically to “url_for” in form?

This is my route:

JavaScript

Advertisement

Answer

Pass it as second argument to url_for

JavaScript

Edit:

For the dynamic one, you simply pass the variable.

JavaScript

and when you are rendering the template, send your dynamic value.

JavaScript

Refer: https://flask.palletsprojects.com/en/2.1.x/quickstart/#url-building

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement