标签:from pre reg div name 返回 反转 import return
from flask import Flask,render_template app = Flask(__name__) @app.route(‘/‘) def index(): return render_template(‘index.html‘) @app.route(‘/login/‘) def login(): return render_template(‘login.html‘) @app.route(‘/regist/‘) def regist(): return render_template(‘regist.html‘) if __name__ == ‘__main__‘: app.run(debug=True)
<a href="{{ url_for(‘index‘) }}">首页</a> <a href="http://127.0.0.1:5000/login">登录</a> <a href="{{ url_for(‘regist‘) }}">注册</a>
标签:from pre reg div name 返回 反转 import return
原文地址:http://www.cnblogs.com/lianghaohui123/p/7780478.html