文章詳情頁(yè)
python - Flask內(nèi)如何跳轉(zhuǎn)至其他頁(yè)面。
瀏覽:115日期:2022-09-03 11:10:20
問(wèn)題描述
為了能從當(dāng)前的路由跳轉(zhuǎn)至其他路由,我如下寫的:
@app.route(’/’,methods=[’POST’,’GET’])def index(): if request.args.get(’data’,type=int)==1: #判斷是否前往return redirect(url_for(’about’)) return render_template(’index.html’)@app.route(’/about’) def about(): : :return render_template(’about.html’)
但是沒(méi)有用,然后我又改成:
return render_template(’about.html’)
然后依然沒(méi)用,頁(yè)面都不會(huì)跳轉(zhuǎn) (肯定進(jìn)了if的)現(xiàn)在很茫然,不知道怎么辦 求教
問(wèn)題解答
回答1:加個(gè)點(diǎn)
redirect(url_for('.about'))
相關(guān)文章:
1. webpack - vuejs+java前后臺(tái)分離實(shí)現(xiàn)及部署問(wèn)題2. css3 - jquery div 翻轉(zhuǎn)?3. docker容器呢SSH為什么連不通呢?4. docker鏡像push報(bào)錯(cuò)5. docker start -a dockername 老是卡住,什么情況?6. python - 有什么好的可以收集貨幣基金的資源?7. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.8. docker網(wǎng)絡(luò)端口映射,沒(méi)有方便點(diǎn)的操作方法么?9. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問(wèn)題10. golang - 用IDE看docker源碼時(shí)的小問(wèn)題
排行榜

熱門標(biāo)簽