标签:color block char extend this body meta pre htm
视图函数:
@app.route("/extend") def extend(): return render_template("extend.html")
基础:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <p>this is json</p> <p> {% if user %} {{ user.qq }} {% endif %} </p> <p> {% for i in list %} {{ i }} {% endfor %} </p> {% block content %} {% endblock content %} </body> </html>
继承:
{% extends "index.html" %} {% block content %} <h1>hello 9980</h1> {% endblock content %}
结果:
很显然,仅仅替换了动态数据
标签:color block char extend this body meta pre htm
原文地址:https://www.cnblogs.com/topass123/p/13172516.html