02模板渲染和參數(補充:URL傳參到視圖)

先拋出代碼: @app.route('/') def index(): return render_template('index.html',username ="鄭勇") 問題:形如「username」的參數過多會影響維護,解決方案? 用字典的形式寫就好。 @app.route('/') def index(): content = { 'username':
相關文章
相關標籤/搜索