上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 34 下一页
摘要: 一.解析器组件 -解析器组件是用来解析用户请求数据的(application/json), content-type 将客户端发来的json数据进行解析 -必须适应APIView -request.data触发 二.序列化组件 2.1.django 自带组件serializer 1 #re_path 阅读全文
posted @ 2018-12-07 17:53 逆欢 阅读(199) 评论(0) 推荐(0)
摘要: 一.关于路由 1.使用vue router 本质上是声明一种可以通过路径进行 挂子,用子 找到对应的 template 进行页面渲染 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Tit 阅读全文
posted @ 2018-12-04 23:28 逆欢 阅读(515) 评论(0) 推荐(0)
摘要: AXIOS 本质上等同于json 传值 1.引用 1 //引入axios 2 import Axios from 'axios' 3 //将axios挂载到 Vue原型上 4 Vue.prototype.$https = Axios 5 6 //设置公共的url 7 Axios.defaults.b 阅读全文
posted @ 2018-12-04 23:02 逆欢 阅读(141) 评论(0) 推荐(0)
摘要: 1.导入vuex vuex是基于vue 的 1 import Vuex from 'vuex' 2 Vue.use(Vuex); 2.创建store 实例 1 let store = new Vuex.Store({ 2 state:{ 3 count:1 4 }, 5 mutations:{ 6 阅读全文
posted @ 2018-12-04 22:44 逆欢 阅读(148) 评论(0) 推荐(0)
摘要: 1 cookie session auth cookie概念:针对每一个服务器,保存在客户端浏览器的一个key-value结构数据,可以理解成一个字典结构 cookie语法: obj=HttpResponse() obj=render() obj=redirect() # 设置cookie obj. 阅读全文
posted @ 2018-11-23 20:02 逆欢 阅读(98) 评论(0) 推荐(0)
摘要: 1.多表操作 添加记录: 针对一对多 book_obj=Book.objects.create(title="python葵花宝典",price=100,publishDate="2012-12-12",publish_id=1) pub_obj=Publish.objects.get(pk=1) 阅读全文
posted @ 2018-11-23 19:46 逆欢 阅读(156) 评论(0) 推荐(0)
摘要: ORM: class Book(models.Model): title=models.CharFiled(max_length=32) 类 表 # Book app01_book 属性变量 字段 # title title 属性对象 约束 # models.CharFiled(max_length 阅读全文
posted @ 2018-11-23 18:00 逆欢 阅读(121) 评论(0) 推荐(0)
摘要: 1.web应用 本质是基于socket实现的应用程序 浏览器 服务器 2.http协议:应用层协议 1.基于TCP协议 2.基于请求响应 3.短连接 4.无状态 请求协议 浏览器 >服务器 请求协议 服务器 >浏览器 响应协议 3.请求协议 请求首行 get path?get数据 HTTP/1.1 阅读全文
posted @ 2018-11-22 22:00 逆欢 阅读(99) 评论(0) 推荐(0)
摘要: 1.views.py 1 from django.db import models 2 3 class Menu(models.Model): 4 title = models.CharField(max_length=32, verbose_name='菜单') 5 icon = models.C 阅读全文
posted @ 2018-11-22 21:41 逆欢 阅读(140) 评论(0) 推荐(0)
摘要: 1. 复杂版 统计,通过跨表查询和timedate模块过滤找到 1 from django.db.models import Count 2 3 class TongJiView(View): 4 def today(self): 5 import datetime 6 today=datetime 阅读全文
posted @ 2018-11-20 21:58 逆欢 阅读(984) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 34 下一页