摘要: models.py: from django.db import models class UserGroup(models.Model): title = models.CharField(max_length=32) class UserInfo(models.Model): user_type 阅读全文
posted @ 2021-01-18 23:53 Sch01aR# 阅读(1125) 评论(0) 推荐(0) 编辑
摘要: model.py: from django.db import models class Role(models.Model): title = models.CharField(max_length=32) 在 role 表中创建数据 方法一:平常的方法 views.py: from drf im 阅读全文
posted @ 2021-01-18 20:40 Sch01aR# 阅读(98) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/sch01ar/p/11271914.html request.POST 的数据是从 request.body 中提取的,request.POST 有数据需要两个前提条件。 一,请求头中 Content-Type 的值为 application/x-w 阅读全文
posted @ 2021-01-18 16:47 Sch01aR# 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 自定义类实现: views.py: from django.shortcuts import HttpResponse from rest_framework.views import APIView from rest_framework.versioning import BaseVersion 阅读全文
posted @ 2021-01-18 15:47 Sch01aR# 阅读(86) 评论(0) 推荐(0) 编辑