标签:设置 视图 main run alt 技术分享 png .com gis
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>
标签:设置 视图 main run alt 技术分享 png .com gis
原文地址:http://www.cnblogs.com/JUNJUNER/p/7779321.html