python Flask in how to reference css, js and other resources html template

Existing static page, you need to integrate it into the bottle of the project, you need to figure out,

Before in HTML:

<link rel =“stylesheet”href =“css / framework7.ios.css”>
<link rel =“stylesheet”href =“css / framework7.ios.colors.css”>

akin:

<img src =“img / avatar / navi_add_lightblue_24x24.svg”/>

Read:

<img src =“{{url_for('static',filename ='img / avatar / navi_add_lightblue_24x24.svg')}}”/>

Then turned out, he was right

 

Guess you like

Origin www.cnblogs.com/dingjiaoyang/p/11014985.html