上一页 1 ··· 22 23 24 25 26
摘要: 查询所以用户 http ://192.168.58.100:8888/user/apiview/ 2.2 创建用户 http://192.168.56.100:8888/user/apiview/ 2.3 更新用户信息 http://192.168.65.100:8888/user/user/api 阅读全文
posted @ 2020-09-28 16:53 小虾米爱吃鱼 阅读(70) 评论(0) 推荐(0)
摘要: ModelViewSet 是对 APIView 封装 ModelSerializer 是对Serializer 封装 1.1 在 user/url.py 中添加路由 urlpatterns =[ path(' apiview ') , views.UserInfoViewSet.as_view()) 阅读全文
posted @ 2020-09-28 16:42 小虾米爱吃鱼 阅读(143) 评论(0) 推荐(0)
摘要: from django.urls import path,include from user import views from rest_framework.routers import SimpleRouter,DefaultRouter router=DefaultRouter() route 阅读全文
posted @ 2020-09-27 21:50 小虾米爱吃鱼 阅读(111) 评论(0) 推荐(0)
摘要: from django.shortcuts import render # Create your views here. from django.http import HttpResponse from django_filters.rest_framework import DjangoFil 阅读全文
posted @ 2020-09-27 21:49 小虾米爱吃鱼 阅读(152) 评论(0) 推荐(0)
摘要: from rest_framework import serializers from user.models import User def address_validate(data): return data class UserSerializer(serializers.ModelSeri 阅读全文
posted @ 2020-09-27 21:47 小虾米爱吃鱼 阅读(166) 评论(0) 推荐(0)
摘要: 1认证 2 权限 3限流 4序列化 5分页 6 版本 1.1 安装DjangoRestFramework pip install djangorestframework == 3.11.1 pip install django-filter == 2.3.0 pip install markdown 阅读全文
posted @ 2020-09-27 21:46 小虾米爱吃鱼 阅读(61) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26