上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 24 下一页
摘要: SQLAlchemy 是一个 ORM框架:类对应表,类中的字段对应表中的列,类的对象对应表的一条记录;作用:帮助我们使用类和对象快速实现数据库操作操作数据库的方式: 1. 原生SQL - pymysql :支持 python2 和 python3 - MySQLdb :只支持 python2 2. 阅读全文
posted @ 2019-01-22 01:16 neozheng 阅读(1264) 评论(0) 推荐(0) 编辑
摘要: 在HTTP协议中,post提交的数据必须放在消息主体中,但是协议中并没有规定必须使用什么编码方式,从而导致了 提交方式 的不同。服务端根据请求头中的 Content-Type 字段来获知请求中的消息主体是用何种方式进行编码,再对消息主体进行解析。 具体的编码方式包括如下: 下面使用requests来 阅读全文
posted @ 2019-01-21 00:59 neozheng 阅读(12554) 评论(3) 推荐(0) 编辑
摘要: wtforms 组件的作用: 生成 HTML 标签 form 表单验证 示例代码: app.py helper.py templates/login.html templates/register.html 注:要积累自己的 模板库(如:后台管理的前端模板页面) wtforms的钩子函数: 阅读全文
posted @ 2019-01-06 23:15 neozheng 阅读(308) 评论(0) 推荐(0) 编辑
摘要: requests介绍: reqeusts模块:python原生一个基于网络请求的模块,模拟浏览器发起请求。 requests模块的优点: reqeusts的使用流程: requests的使用: 一、 requests基础用法: 1. 基于requests模块发起get请求 需求:爬取搜狗首页的页面数 阅读全文
posted @ 2018-12-22 13:20 neozheng 阅读(347) 评论(0) 推荐(0) 编辑
摘要: socketserver: socketserver可用于实现并发通信。 socketserver 模块简化了编写网络服务程序的任务;同时 SocketServer 模块也是 Python标准库中很多服务器框架的基础。socketserver 模块可以简化网络服务器的编写。Python把网络服务抽象 阅读全文
posted @ 2018-12-21 22:21 neozheng 阅读(3484) 评论(0) 推荐(0) 编辑
摘要: Session: flash: 特殊装饰器:(重点) Blueprint:蓝图 示例目录: manage.py crm/__init__.py crm/views/account.py crm/views/user.py 蓝图的作用: 路由的正则匹配: 上下文管理: 请求--视图--响应 大致流程: 阅读全文
posted @ 2018-12-20 23:12 neozheng 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 视图: 视图,虚拟表 创建虚拟表: # 语法: # create view 虚拟表名称 as 虚拟表; create view course_and_teacher as select * from course inner join teacher on course.teacher_id = t 阅读全文
posted @ 2018-12-20 13:52 neozheng 阅读(332) 评论(0) 推荐(0) 编辑
摘要: GitHub 中搜索:social django app ==>找到: python-social-auth/social-app-django文档: https://python-social-auth.readthedocs.io/en/latest/ 阅读全文
posted @ 2018-11-01 22:28 neozheng 阅读(390) 评论(0) 推荐(0) 编辑
摘要: JWT 相关信息可参考: https://www.jianshu.com/p/576dbf44b2ae DRF JWT 的使用方法: 1. 安装 DRF JWT 2. 配置 3. 在 url 中添加相应路径 4. 前端向 login/ 这个路径发送请求时可进行登陆验证; 5. 访问需要登陆认证后才能 阅读全文
posted @ 2018-10-25 21:06 neozheng 阅读(4703) 评论(0) 推荐(1) 编辑
摘要: 利用云片网发送短信验证码: # 1. 在云片网后台申请 签名 和 模板 # 2. 在 系统设置 中添加 IP白名单 (服务器IP或者你自己本地的IP地址) # 3. 选择 单条发送,查看接口使用说明 接口代码示例: 阅读全文
posted @ 2018-10-24 23:07 neozheng 阅读(720) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 24 下一页