![在这里插入图片描述](https://img-blog.csdnimg.cn/20190701142640918.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNTQyMDc0,size_16,color_FFFFFF,t_70)
第一个Python文件
from flask import Flask,render_template
app = Flask(__name__,template_folder='../templates',static_folder="../static",static_url_path="")
@app.route("/hello")
def hello():
return "Hello World"
@app.route("/lll")
def lll():
return "夏玉清"
@app.route("/lll/<name>")
def lll_name(name):
return render_template('2222.html',namex=name)
if __name__ == '__main__':
app.run(host='0.0.0.0')
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2019/7/1</title>
</head>
<body>
<h1>今天的第一个html</h1><br/>
<span style="background-color: aquamarine">今天是2019年7月1日</span><br>
<span style="background-color: orange">namex为:{{namex}}!</span>
<img src="{{url_for('static',filename='images/23.jpg')}}"/>
</body>
</html>
![在这里插入图片描述](https://img-blog.csdnimg.cn/2019070114273482.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNTQyMDc0,size_16,color_FFFFFF,t_70)