摘要:
前言全局说明 Python Flask 网页URL路由设置别名(alias) endpoint 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/si 阅读全文
posted @ 2024-01-06 22:13
悟透
阅读(103)
评论(0)
推荐(0)
摘要:
前言全局说明 VScode Python 语法模块等没有高亮关键字提示,点击也无法进入模块源码 一、获取模块安装位置 pip3 show flask 如图,知道模块安装路径在 /home/qt/.local/lib/python3.8/site-packages 二、修改 VScode 配置文件 2 阅读全文
posted @ 2024-01-06 21:20
悟透
阅读(964)
评论(0)
推荐(0)
摘要:
前言全局说明 Python Flask 修改html 模板存放路径 一、修改 html 模板默认存放文件夹名 templates 假设不想用默认的 templates 名,要用 html_dir app=Flask(__name__, templates_folder='html_dir') 免责声 阅读全文
posted @ 2024-01-06 20:14
悟透
阅读(197)
评论(0)
推荐(0)
摘要:
前言全局说明 python flask 返回json数据 一、安装flask模块 官方源: pip3 install flask 国内源: pip3 install flask -i http://pypi.douban.com/simple/ --trusted-host pypi.douban. 阅读全文
posted @ 2024-01-06 20:04
悟透
阅读(234)
评论(0)
推荐(0)
摘要:
一、官方pip源 不使用-i参数指定,默认就是官方源 二、国内pip源 豆瓣:http://pypi.douban.com/simple/ 阿里:http://mirrors.aliyun.com/pypi/simple/ 清华:https://pypi.tuna.tsinghua.edu.cn/s 阅读全文
posted @ 2024-01-06 19:15
悟透
阅读(5969)
评论(0)
推荐(0)
摘要:
前言全局说明 python flask get请求接收参数 一、安装flask模块 官方源: pip3 install flask 国内源: pip3 install flask -i http://pypi.douban.com/simple/ --trusted-host pypi.douban 阅读全文
posted @ 2024-01-06 18:40
悟透
阅读(967)
评论(0)
推荐(0)
摘要:
前言全局说明 python 提供的web服务 方式一、运行 Flask 服务 使用python 自带的web服务器 python3 index.py runserver 0.0.0.0:5000 或 python3 index.py runserver index.py 是你写好,要运行的 flas 阅读全文
posted @ 2024-01-06 17:19
悟透
阅读(171)
评论(0)
推荐(0)
摘要:
Python flask 路由是什么,怎么理解? 答: 当用户输入 网址URL 时,会向服务器请求, 服务器接收到的链接,用哪个函数处理, 连接和函数绑定叫路由 @app.route('/login') def login(): return redirect('https://passport.b 阅读全文
posted @ 2024-01-06 16:58
悟透
阅读(16)
评论(0)
推荐(0)
摘要:
前言全局说明 Python flask redirect调用其他函数或url连接 一、安装flask模块 官方源: pip3 install flask 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --truste 阅读全文
posted @ 2024-01-06 16:52
悟透
阅读(331)
评论(0)
推荐(0)