7.5 反向构建URL
法1:直接通过全路径访问
<link type="text/css" rel="stylesheet" href="http://ip:port/static/test.css">法2:通过相对路径
<link type="text/css" rel="stylesheet" href="/static/test.css">法3:通过endpoint反向构建url。
<link type="text/css" rel="stylesheet" href="{{ url_for('static',filename='test.css') }}">Last updated
Was this helpful?