Project name :Flask_Plan

templates:

默认设置下,Flask在程序根目录中名为static的子目录中寻找静态文件。 

随便找个图片放进去把,命令test.png

Flask_Plan/static/test.png

修改模板文件Flask_Plan/templates/plan.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>这是计划页面</h1>
<img src="{{ url_for('static', filename='test.png') }}">
</body>
</html>
View Code

相关文章:

  • 2021-09-19
  • 2021-04-08
  • 2021-09-29
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2021-06-14
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案