摘要: li=[ {'user':'la','id':1}, {'user':'la','id':2}, {'user':'la','id':13}, {'user':'la','id':4}]dic={}for line in li: dic[line['id']]=line# print(dic)pri 阅读全文
posted @ 2017-09-28 14:25 昂达达 阅读(339) 评论(3) 推荐(0) 编辑
摘要: class RegisterForm(Form): # user_id=fields.IntegerField() username=fields.CharField( max_length=12, min_length=4, required=True, error_messages={'requ 阅读全文
posted @ 2017-09-28 11:42 昂达达 阅读(1022) 评论(0) 推荐(0) 编辑
摘要: 请求过来: 中间件:拦截一部分请求;比如验证session, 没有登录的 请求一些页面,跳转至登录页;(图片为中间件的请求过程.) 再到 urls ,分发请求 到views 视图 ,通过 CBV(dispatch反射) 和 FBV 的 get 请求 讲 template 页面渲染返回给用户; 渲染之 阅读全文
posted @ 2017-09-28 10:12 昂达达 阅读(1185) 评论(0) 推荐(0) 编辑