随笔分类 -  DRF

摘要:一、章节分类接口 路由层 course/urls.py from django.urls import path, re_path, include from . import views from rest_framework.routers import SimpleRouter router 阅读全文
posted @ 2022-06-14 14:16 _yessir 阅读(25) 评论(0) 推荐(0) 编辑
摘要:一、课程分类群查接口 路由层 course/urls.py from django.urls import path, re_path, include from . import views from rest_framework.routers import SimpleRouter route 阅读全文
posted @ 2022-06-13 21:48 _yessir 阅读(68) 评论(0) 推荐(0) 编辑
摘要:企业软件开发流程 详见:项目开发流程 pip换源 详见:python之pip换源 1 pip3 install pymysql 国外很慢 2 pip3 install pymysql -i 地址 3 配置,以后pip3 install全走配好的源 -来到C:\Users\oldboy\AppData 阅读全文
posted @ 2022-05-27 21:12 _yessir 阅读(523) 评论(0) 推荐(0) 编辑
摘要:models.py 模型类 from django.db import models from django.contrib.auth.models import AbstractUser class User(AbstractUser): phone = models.CharField(max_ 阅读全文
posted @ 2022-05-23 21:00 _yessir 阅读(226) 评论(0) 推荐(0) 编辑
摘要:JWT认证简介 jwt:json web token,是一种前后端的登录认证方式, 它分token的签发和认证,签发的意思是用户登录成功,生成三段式的token串; 认证指的是用户访问某个带有用户登录权限的接口,需要携带token串过来,完成认证。三段式分为头、荷载和签名。 认证通过头和荷载,通过加 阅读全文
posted @ 2022-05-23 13:51 _yessir 阅读(201) 评论(0) 推荐(0) 编辑
摘要:REST framework可以自动帮助我们生成接口文档。 接口文档以网页的方式呈现。 自动接口文档能生成的是继承自APIView及其子类的视图。 1.安装依赖 REST FRAMEWORK 生成接口文档需要coreapi的支持 pip install coreapi 2.设置接口文档访问路径 在总 阅读全文
posted @ 2022-05-22 15:38 _yessir 阅读(135) 评论(0) 推荐(0) 编辑
摘要:模型类 from django.db import models # Create your models here. class BaseModel(models.Model): create_time = models.DateTimeField(auto_now_add=True) is_de 阅读全文
posted @ 2022-05-20 20:42 _yessir 阅读(142) 评论(0) 推荐(0) 编辑
摘要:Django-rest framework官方文档 更多详情参考:Django-rest framework框架 初识DRF web开发模式 #前后端混合开发(前后端不分离):返回的是html的内容,需要写模板 #前后端分离:只专注于写后端接口,返回json,xml格式数据 # xml格式 <xml 阅读全文
posted @ 2022-05-04 14:12 _yessir 阅读(144) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示