摘要: 1 Auth模块是什么 Auth模块是Django自带的用户认证模块: 我们在开发一个网站的时候,无可避免的需要设计实现网站的用户系统。此时我们需要实现包括用户注册、用户登录、用户认证、注销、修改密码等功能,这还真是个麻烦的事情呢。 Django作为一个完美主义者的终极框架,当然也会想到用户的这些痛 阅读全文
posted @ 2019-10-30 12:06 杨鑫Zz 阅读(175) 评论(0) 推荐(0)
摘要: 一些说明: 表myapp_person的名称是自动生成的,如果你要自定义表名,需要在model的Meta类中指定 db_table 参数,强烈建议使用小写表名,特别是使用MySQL作为后端数据库时。 id字段是自动添加的,如果你想要指定自定义主键,只需在其中一个字段中指定 primary_key=T 阅读全文
posted @ 2019-10-30 12:04 杨鑫Zz 阅读(220) 评论(0) 推荐(0)
摘要: 路由跳转 ? 1 2 3 4 5 6 this.$router.push('/course'); this.$router.push({name: course}); this.$router.go(-1); this.$router.go(1); <router-link to="/course" 阅读全文
posted @ 2019-10-30 12:02 杨鑫Zz 阅读(348) 评论(0) 推荐(0)
摘要: 解析模块 为什么要配置解析模块 ? 1 2 3 4 5 """ 1)drf给我们通过了多种解析数据包方式的解析类 2)我们可以通过配置来控制前台提交的哪些格式的数据后台在解析,哪些数据不解析 3)全局配置就是针对每一个视图类,局部配置就是针对指定的视图来,让它们可以按照配置规则选择性解析数据 """ 阅读全文
posted @ 2019-10-30 11:08 杨鑫Zz 阅读(184) 评论(0) 推荐(0)
摘要: 视图家族 GenericAPIView基类 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 # GenericAPIView是继承APIView的,使用完全兼容APIView # 重点:Gene 阅读全文
posted @ 2019-10-30 11:06 杨鑫Zz 阅读(95) 评论(0) 推荐(0)
摘要: 课程准备 配置:settings.py ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 INSTALLED_APPS = [ # ... 'rest_framework', ] ​ DATABASES 阅读全文
posted @ 2019-10-30 10:58 杨鑫Zz 阅读(110) 评论(0) 推荐(0)
摘要: drf-jwt插件 官网 ? 1 https://github.com/jpadilla/django-rest-framework-jwt 安装 ? 1 >: pip3 install djangorestframework-jwt 登录 - 签发token:api/urls.py ? 1 2 3 阅读全文
posted @ 2019-10-30 10:57 杨鑫Zz 阅读(117) 评论(0) 推荐(0)
摘要: 群查接口各种筛选组件数据准备 models.py ? 1 2 3 4 5 6 7 8 9 10 11 12 class Car(models.Model): name = models.CharField(max_length=16, unique=True, verbose_name='车名') 阅读全文
posted @ 2019-10-30 10:55 杨鑫Zz 阅读(173) 评论(0) 推荐(0)
摘要: pip install django-cors-headers pip install django-cors-headers 注册应用 INSTALLED_APPS = ( ... 'corsheaders', ... ) INSTALLED_APPS = ( ... 'corsheaders', 阅读全文
posted @ 2019-10-30 09:25 杨鑫Zz 阅读(402) 评论(0) 推荐(0)