赞
踩
{% block top%}
顶部菜单
{% endblock top%}
{% block content%}
内容
{% endblock content%}
{% block bottom%}
底部
{% endblock bottom%}
{% extends 'base.html'%}
{% block content%}
需要填充的内容
{% endblock content%}
参考文档:
https://www.cnblogs.com/alexzhang92/p/9545575.html
https://www.jianshu.com/p/8021f258f6f1
from flask import Flask, session, request, url_for, render_template, redirect, flash
app.secret_key = '1'
flag =True
@app.route('/index')
def index():
if flag:
#添加闪现信息
flash('hello1')
flash('hello2')
flash('hello3')
global flag
flag = False
return render_template('HomePage/index_copy.html')
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>闪现信息</title>
</head>
<body>
{% for message in get_flashed_messages() %}
{{ message }}
{% endfor %}
</body>
</html>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。