摘要:
Django内置的Admin是对于model中对应的数据表进行增删改查提供的组件,使用方式有: 依赖APP: django.contrib.auth django.contrib.contenttypes django.contrib.messages django.contrib.sessions 阅读全文
2017年12月13日 #
2017年12月12日 #
摘要:
requests Python标准库中提供了:urllib、urllib2、httplib等模块以供Http请求,但是,它的 API 太渣了。它是为另一个时代、另一个互联网所创建的。它需要巨量的工作,甚至包括各种方法覆盖,来完成最简单的任务。 Requests 是使用 Apache2 License 阅读全文
2017年12月6日 #
摘要:
ModelForm a. class Meta: model, # 对应Model的 fields=None, # 字段 exclude=None, # 排除字段 labels=None, # 提示信息 help_texts=None, # 帮助提示信息 widgets=None, # 自定义插件 阅读全文
2017年11月21日 #
摘要:
def get_veri(req): img = Image.new(mode='RGB', size=(120, 40), #图片大小 color=(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))) d 阅读全文
2017年11月13日 #
摘要:
Ajax准备知识:json 什么是json? 定义: 讲json对象,不得不提到JS对象: 合格的json对象: ["one", "two", "three"] { "one": 1, "two": 2, "three": 3 } {"names": ["张三", "李四"] } [ { "name 阅读全文
2017年11月6日 #
摘要:
1 准备环境 >part1: iptables -F #systemctl disable firewalld #开机默认关闭 #systemctl stop firewalld #立即关闭 #systemctl status firewalld setenforce 0 #/etc/sysconf 阅读全文
摘要:
配置 from django.conf import settings form组件 from django.forms import Formfrom django.forms import fieldsfrom django.forms import widgets form自定义规则from 阅读全文
2017年11月3日 #
摘要:
Model常用操作: - 参数:filter - all,values,values_list [obj(id,name,pwd,email),obj(id,name,pwd,email),] models.UserInfo.objects.all() [obj(id,name,email)] # 阅读全文
2017年11月1日 #
摘要:
在C语言中定义常量的两种方式 在C语言编程中定义常量有两种方法。 const关键字 #define预处理器 1. const关键字 const关键字用于定义C语言编程中的常量。 C C 现在,PI变量的值不能改变。 1. if语句 if语句的语法如下 - 我们来看一个简单的c语言if语句的示例代码, 阅读全文