随笔分类 -  Python & Jython / Flask

摘要:前言全局说明 一、安装flask模块 二、引用模块 三、启动服务 模块安装、引用模块、启动Web服务方法,参考下面链接文章: https://www.cnblogs.com/wutou/p/17963563 四、面向对象的私有属性获取 4.1.2 class Foo: def __init__(se 阅读全文
posted @ 2024-01-17 13:15 悟透 阅读(57) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 Class类默认方法(函数) 一、安装flask模块 二、引用模块 三、启动服务 模块安装、引用模块、启动Web服务方法,参考下面链接文章: https://www.cnblogs.com/wutou/p/17963563 四、Class类默认方法(函数) 默认方法(函数) 说明 备注 阅读全文
posted @ 2024-01-14 13:49 悟透 阅读(152) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 模块安装、引用模块、启动服务 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-host pypi. 阅读全文
posted @ 2024-01-14 12:50 悟透 阅读(220) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 Python Flask 特殊装饰器,执行路由前和执行路由后执行的装饰器 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple 阅读全文
posted @ 2024-01-11 18:11 悟透 阅读(72) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com 以上二选 阅读全文
posted @ 2024-01-11 13:27 悟透 阅读(135) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com 以上二选 阅读全文
posted @ 2024-01-11 12:57 悟透 阅读(216) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 Python Flask config 配置文件 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted- 阅读全文
posted @ 2024-01-10 21:57 悟透 阅读(844) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 Python Flask session 内容保存到用户浏览器里 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ -- 阅读全文
posted @ 2024-01-07 00:29 悟透 阅读(69) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 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 悟透 阅读(85) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 Python Flask 修改html 模板存放路径 一、修改 html 模板默认存放文件夹名 templates 假设不想用默认的 templates 名,要用 html_dir app=Flask(__name__, templates_folder='html_dir') 免责声 阅读全文
posted @ 2024-01-06 20:14 悟透 阅读(162) 评论(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 悟透 阅读(198) 评论(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 悟透 阅读(5316) 评论(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 悟透 阅读(888) 评论(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 悟透 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Python flask 路由是什么,怎么理解? 答: 当用户输入 网址URL 时,会向服务器请求, 服务器接收到的链接,用哪个函数处理, 连接和函数绑定叫路由 @app.route('/login') def login(): return redirect('https://passport.b 阅读全文
posted @ 2024-01-06 16:58 悟透 阅读(13) 评论(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 悟透 阅读(275) 评论(0) 推荐(0) 编辑
摘要:前言全局说明 Python flask 网页版执行shell命令并返回结果 源码下载:https://files.cnblogs.com/files/wutou/py_flask_cmd.zip (7.21KB) 一、需要安装的库 pip3 install flask==2.3.2 -i http: 阅读全文
posted @ 2024-01-05 18:01 悟透 阅读(212) 评论(0) 推荐(0) 编辑
摘要:前言 flask 下载功能 一、约定 要下载文件绝对路径:/tmp/flask_web/download/test.tar.gz py主程序:/tmp/flask_web/main.py 二、main.py 内容 @app.route("/down/<path:filename>", methods 阅读全文
posted @ 2023-11-30 15:19 悟透 阅读(438) 评论(0) 推荐(0) 编辑
摘要:## 方法一: ```bash $ sudo nohup python app1c.py >log.txt 2>&1 & ``` nohup允许运行从 shell 注销后可以在后台继续运行的命令/进程或 shell 脚本。 > log.txt : 它将输出转发到该文件。 > 2>&1 : 将所有标准 阅读全文
posted @ 2023-07-25 09:46 悟透 阅读(560) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示