@app.route('/usercenter/')def usercenter(user_id): user = User.query.filter(User.id == user_id).first() context = { 'username': user.username, 'wenda': user.wenda, 'comments': user.comment } return render_template('usercenter.html',**context)
{% block switchbody %}{% endblock %}{% for foo in wenda %} {% endfor %}
{% extends 'switch.html' %}{% block usercentertitle %}个人中心{% endblock %}{% block usercenterhead %}{% endblock %}{% block switchbody %}{% for foo in wenda %} {% endfor %}{% for foo in comments %}{ { foo.author.username }} { { foo.create_time }} {% endfor %}{
{ foo.detail }}