@app.route('/usercenter/ / ')@loginFirstdef usercenter(user_id,tag): user = User.query.filter(User.id == user_id).first() context = { 'user': user } if tag =='1': return render_template('user1.html',**context) elif tag =='2': return render_template('user2.html', **context) else: return render_template('user3.html', **context)
{% extends 'base.html' %}{% block userbasetitle %}用户详情{% endblock %}{% block userbasehead %} {% endblock %} {% block userbasebody %}
{% block gerenbody %} {% endblock %} {% endblock %}