Flask url_for URLs in Javascript

前端 未结 8 2073
粉色の甜心
粉色の甜心 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:15

    @jeremy's answer is correct and probably the more common approach, but as an alternative answer, note that dantezhu wrote and published a flask extension that claims to do the exact url-route-map-to-javascript translation suggested in the comment.

提交回复
热议问题