摘要: 请求HttpRequest 提示: 用户发送请求时携带的参数后端需要使用,而不同的发送参数的方式对应了不同的提取参数的方式 所以要学会如何提取参数,我们就需要先了解前端传参数有哪些方式 回想一下,利用HTTP协议向服务器传参有几种途径? 查询字符串数据(query string): 形如:?key1 阅读全文
posted @ 2021-01-18 23:24 hello_Ms_w 阅读(2699) 评论(0) 推荐(0) 编辑
摘要: MVC 有一种程序设计模式叫 MVC,其核心思想是分工, 解耦,让不同的代码块之间降低耦合,增强代码的可扩展性和可移植性,实现向后兼容**。 MVC 的全拼为 Model-View-Controller ,最早由 TrygveReenskaug 在1978年提出,是施乐帕罗奥多研究中心( Xerox 阅读全文
posted @ 2021-01-14 23:07 hello_Ms_w 阅读(180) 评论(0) 推荐(0) 编辑
摘要: # views.py from datetime import datetime class BooksAPIVIew(View): """ 查询所有图书、增加图书 """ def get(self, request): """ 查询所有图书 路由:GET /books/ """ queryset 阅读全文
posted @ 2021-01-14 22:25 hello_Ms_w 阅读(139) 评论(0) 推荐(0) 编辑
摘要: pip install pymongo # 导入模块 from pymongo import MongoClient # 如果是本地连接host,port参数可以省略 # client = MongoClient() # 1.连接ubantu的mongodb客户端 client = MongoCli 阅读全文
posted @ 2020-11-12 22:23 hello_Ms_w 阅读(84) 评论(0) 推荐(0) 编辑
摘要: # 1. 查询所有商品信息 def __fetch_all_info(self): cur = self.db_connect.cursor() sql_str = '''select * from goods''' cur.execute(sql_str) result = cur.fetchal 阅读全文
posted @ 2020-11-12 21:28 hello_Ms_w 阅读(143) 评论(0) 推荐(0) 编辑
摘要: import pymysql # 创建连接对象 conn = pymysql.connect(host='localhost', port=3306, user='root', password='mysql',database='python', charset='utf8') # 获取游标对象 阅读全文
posted @ 2020-11-12 21:23 hello_Ms_w 阅读(5346) 评论(0) 推荐(0) 编辑
摘要: import pymysql # 创建连接对象 conn = pymysql.connect(host='localhost', port=3306, user='root', password='mysql',database='python', charset='utf8') # 获取游标对象 阅读全文
posted @ 2020-11-12 21:21 hello_Ms_w 阅读(124) 评论(0) 推荐(0) 编辑
摘要: from pymysql import connect def main(): find_name = input("请输入物品名称:") # 创建Connection连接 conn = connect(host='localhost',port=3306,user='root',password= 阅读全文
posted @ 2020-11-12 21:20 hello_Ms_w 阅读(118) 评论(0) 推荐(0) 编辑
摘要: string set setex mset append get mget key keys exists type delete expire getrange ttl hash hset hmset hkeys hget hmget hvals hdel list lpush rpush lin 阅读全文
posted @ 2020-10-08 18:11 hello_Ms_w 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1 from qiniu import Auth, put_file, etag, put_data 2 import qiniu.config 3 from flask import current_app 4 5 6 def upload_img(data): 7 """ 8 上传二进制数据到七 阅读全文
posted @ 2020-09-30 08:51 hello_Ms_w 阅读(778) 评论(0) 推荐(0) 编辑