久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

您的位置:首頁技術文章
文章詳情頁

Python flask框架實現瀏覽器點擊自定義跳轉頁面

瀏覽:31日期:2022-07-23 08:43:29

代碼如下

_init_.py

from flask import Flask, request, url_for, redirect, render_templateapp = Flask(__name__)@app.route(’/’)def index(): return render_template(’index.html’)@app.route(’/cool_form’, methods=[’GET’, ’POST’])def cool_form(): if request.method == ’POST’: # do stuff when the form is submitted # redirect to end the POST handling # the redirect can be to the same route or somewhere else return redirect(url_for(’index’)) # show the form, it wasn’t submitted return render_template(’cool_form.html’)

index.html

<!doctype html><html><body> <p><a href='http://www.gepszalag.com/bcjs/{{ url_for(’cool_form’) }}' rel='external nofollow' >Check out this cool form!</a></p></body></html>

cool_form.html

<!doctype html><html><body> <form method='post'> <button type='submit'>Do it!</button> </form></html>

運行結果

Python flask框架實現瀏覽器點擊自定義跳轉頁面

進入5000端口顯示如圖,點擊這個按鈕,跳到自定義的/cool_form頁面

Python flask框架實現瀏覽器點擊自定義跳轉頁面

代碼在github:https://github.com/qingnvsue/flask中的webbutton文件夾

在我的程序里我實現了在web頁面點擊加法器或者除法器按鈕進入相應頁面

Python flask框架實現瀏覽器點擊自定義跳轉頁面

Python flask框架實現瀏覽器點擊自定義跳轉頁面

Python flask框架實現瀏覽器點擊自定義跳轉頁面

代碼在github:https://github.com/qingnvsue/flask中的add文件夾

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 综合久久网 | av片在线观看 | 国产欧美日韩一区二区三区 | 一区二区三区视频播放 | 97色综合| 日韩有码一区 | 精品美女在线观看视频在线观看 | 日韩精品在线网站 | 另类视频在线 | 欧美视频在线播放 | 国产精品美女久久久久aⅴ国产馆 | 欧美精品亚洲 | 精品久久久成人 | 欧美午夜一区二区三区免费大片 | 91看片在线观看 | 中文字幕在线网址 | 免费成人在线观看 | 一级欧美| 在线精品观看 | 欧洲精品在线观看 | 欧洲一区二区三区 | 久久com| 精品一区二区三区四区五区 | 国产欧美精品一区二区三区四区 | 精品国产一区二区三区日日嗨 | 久草精品在线 | 精品少妇一区二区三区 | 欧美激情在线观看 | 中文字幕综合 | 精品免费久久久久久久苍 | 极品白嫩少妇无套内谢 | 欧美精品久久久久久久久老牛影院 | 欧美卡一卡二 | 久国产 | av中文在线 | 欧美一区二区三区aa大片漫 | 国产精品久久嫩一区二区 免费 | 天堂va | 一区二区精品视频 | 91精品在线播放 | 国产色在线 |