# # 集合:# se1 = { 1,3,4,5,'a'} # 如果直接添加元素,不能直接添加可变元素# se2 = set() # 定义一个空集合# se3 = {'a'} # 定义个单元素的集合# print(se1) # {'a', 1, 3, 4, 5} 证实 set 是无序的# ## 唯一性,去重, # # 交集 两个集合中相同元素组成的集合# se1 = { 1,3,4,5 }# se2 = { 2,3,4,6 }# print( se1 & se2 ) # {3, 4} # # 并…
index.html 首页 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <!--引入本地--> <link rel…
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet&quo…
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet&quo…
index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <link rel="stylesheet" href="css/reset.css"> <link rel="stylesheet&quo…
类的定义 共同属性,特征,方法者,可分为一类,并以名命之 class Abc: # class 定义类, 后面接类名 ( 规则 首字母大写 ) cls_name = '这个类的名字是Abc' # 在类里定义的变量 是 属性 print( Abc.cls_name ) Abc.binbin = '正在25班教室' # 可以通过 类名.属性名 = 属性值 给类添加属性 print( Abc.binbin ) ------>>>>> 这个类的名字是Abc 正在25班教室 类是一个独…
tornado 相关说明 改善图片上传功能 ,生成唯一的 ID ,与路径拼接,生成 URL, 这里引用 uuid 的 python 库 在 photo.py 中创建个类,用来  辅助用户上传的图片,生成相关缩略图,记录图片相关 URL ,并保存到数据库 把用户上传图片,生成缩略图,URL,保存信息到数据库放进一个类里,class UploadImg: """ 辅助用户上传的图片,生成相关缩略图,记录图片相关 URL ,并保存到数据库 """ up…
从讲项目开始,查找错误,完善笔记,尽可能 翻译没一句代码(以后台为主), 本项目亮点,也是重点 Django ORM中对数据查询的优化(only.defer.select_related) redis缓存短信验证码.图片验证码.用户session 使用docker容器搭建数据集群负载均衡.读写分离 使用django缓存机制 User模型的拓展 数据库的设计能力 数据库的多表关联设计 数据库更新的优化 django信号机制使用 使用celery发送手机短信 自定义用户.用户组以及权限的管理 使用d…
get 请求, 1,获取文章标签 , 2,拿到前台传来的值, 3,根据前台传来的值在数据库中查询 4.,返回数据到前台,渲染, 分页算法 : 在 utils 下创建  paginator_script.py def get_paginator_data(paginator, current_page, around_count=3): """ :param paginator: 分页对象 :param current_page: 当前页数据 :param around_cou…
官方文档: https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository 1,更新下sudo apt-get update 2,安装包以允许apt通过HTTPS使用存储库: sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common 3,添加Docker的官方GPG密钥:…