随笔分类 - Python & Jython / Flask
摘要:前言全局说明 一、安装flask模块 二、引用模块 三、启动服务 模块安装、引用模块、启动Web服务方法,参考下面链接文章: https://www.cnblogs.com/wutou/p/17963563 四、面向对象的私有属性获取 4.1.2 class Foo: def __init__(se
阅读全文
摘要:前言全局说明 Class类默认方法(函数) 一、安装flask模块 二、引用模块 三、启动服务 模块安装、引用模块、启动Web服务方法,参考下面链接文章: https://www.cnblogs.com/wutou/p/17963563 四、Class类默认方法(函数) 默认方法(函数) 说明 备注
阅读全文
摘要:前言全局说明 模块安装、引用模块、启动服务 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.
阅读全文
摘要:前言全局说明 Python Flask 特殊装饰器,执行路由前和执行路由后执行的装饰器 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple
阅读全文
摘要:前言全局说明 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com 以上二选
阅读全文
摘要:前言全局说明 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com 以上二选
阅读全文
摘要:前言全局说明 Python Flask config 配置文件 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --trusted-
阅读全文
摘要:前言全局说明 Python Flask session 内容保存到用户浏览器里 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --
阅读全文
摘要:前言全局说明 Python Flask 网页URL路由设置别名(alias) endpoint 一、安装flask模块 官方源: pip3 install flask==2.3.2 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/si
阅读全文
摘要:前言全局说明 Python Flask 修改html 模板存放路径 一、修改 html 模板默认存放文件夹名 templates 假设不想用默认的 templates 名,要用 html_dir app=Flask(__name__, templates_folder='html_dir') 免责声
阅读全文
摘要:前言全局说明 python flask 返回json数据 一、安装flask模块 官方源: pip3 install flask 国内源: pip3 install flask -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.
阅读全文
摘要:一、官方pip源 不使用-i参数指定,默认就是官方源 二、国内pip源 豆瓣:http://pypi.douban.com/simple/ 阿里:http://mirrors.aliyun.com/pypi/simple/ 清华:https://pypi.tuna.tsinghua.edu.cn/s
阅读全文
摘要:前言全局说明 python flask get请求接收参数 一、安装flask模块 官方源: pip3 install flask 国内源: pip3 install flask -i http://pypi.douban.com/simple/ --trusted-host pypi.douban
阅读全文
摘要:前言全局说明 python 提供的web服务 方式一、运行 Flask 服务 使用python 自带的web服务器 python3 index.py runserver 0.0.0.0:5000 或 python3 index.py runserver index.py 是你写好,要运行的 flas
阅读全文
摘要:Python flask 路由是什么,怎么理解? 答: 当用户输入 网址URL 时,会向服务器请求, 服务器接收到的链接,用哪个函数处理, 连接和函数绑定叫路由 @app.route('/login') def login(): return redirect('https://passport.b
阅读全文
摘要:前言全局说明 Python flask redirect调用其他函数或url连接 一、安装flask模块 官方源: pip3 install flask 国内源: pip3 install flask==2.3.2 -i http://pypi.douban.com/simple/ --truste
阅读全文
摘要:前言全局说明 Python flask 网页版执行shell命令并返回结果 源码下载:https://files.cnblogs.com/files/wutou/py_flask_cmd.zip (7.21KB) 一、需要安装的库 pip3 install flask==2.3.2 -i http:
阅读全文
摘要:前言 flask 下载功能 一、约定 要下载文件绝对路径:/tmp/flask_web/download/test.tar.gz py主程序:/tmp/flask_web/main.py 二、main.py 内容 @app.route("/down/<path:filename>", methods
阅读全文
摘要:## 方法一: ```bash $ sudo nohup python app1c.py >log.txt 2>&1 & ``` nohup允许运行从 shell 注销后可以在后台继续运行的命令/进程或 shell 脚本。 > log.txt : 它将输出转发到该文件。 > 2>&1 : 将所有标准
阅读全文