摘要: 1、安装 rpm -i 需要安装的包文件名 举例如下: rpm -i example.rpm 安装 example.rpm 包; rpm -iv example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息; rpm -ivh example.rpm 安装 examp 阅读全文
posted @ 2019-03-29 15:18 G先生 阅读(1575) 评论(0) 推荐(0) 编辑
摘要: 在model中添加字段的格式一般为: field_name = field_type(**field_options) 一 field options(所有字段共用) 1 null 默认为False,True则表示可以为null。(空字符串在数据库中可能被存储为'') 2 blank 默认为Fals 阅读全文
posted @ 2019-03-29 15:07 G先生 阅读(918) 评论(0) 推荐(0) 编辑
摘要: linux 查看系统信息命令是linux初学者必备的基础知识, 下面给除了各linux发行版比较常用的系统信息查询的命令 # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CP 阅读全文
posted @ 2019-03-29 11:33 G先生 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 当我们对某个表需要在创建时,给他绑定一个随机的id,那么我们怎么做呢? 当创建一个用户时执行的为save方法,所以通过下面的 super(UserInfo, self).save(*args, **kwargs)来将生成的md5值赋给这条创建的记录。 import hashlib from djan 阅读全文
posted @ 2019-03-29 11:14 G先生 阅读(376) 评论(0) 推荐(0) 编辑

:guocheng