Flask url_for URLs in Javascript

前端 未结 8 2338
粉色の甜心
粉色の甜心 2021-01-30 10:54

What is the recommended way to create dynamic URLs in Javascript files when using flask? In the jinja2 templates and within the python views url_for is used, what i

8条回答
  •  不知归路
    2021-01-30 11:09

    In my case, I was trying to dynamically create urls

    I solved my issue as follows (Note: I've swapped out Angular's syntax to {[x]}:

    • {[x.title]} {% set url = url_for('static',filename="img/") %}

提交回复
热议问题