摘要: from rest_framework.viewsets import ModelViewSet from .authentication_classes import UserAuth from .permission_classes import UserPerm class BookView( 阅读全文
posted @ 2020-02-21 21:01 y0um 阅读(134) 评论(0) 推荐(0) 编辑
摘要: '''用户认证章节''' # 用户认证章节:写一个数据接口 from django.http import JsonResponse from .utils import get_token from rest_framework.exceptions import APIException cla 阅读全文
posted @ 2020-02-21 19:36 y0um 阅读(161) 评论(0) 推荐(0) 编辑
摘要: '''2.使用viewset优化后的url''' urlpatterns = [ re_path(r'book/$', views.BookView.as_view({ 'get': 'list', 'post': 'create', })), re_path(r'book/(?P<pk>\d+)/ 阅读全文
posted @ 2020-02-21 10:02 y0um 阅读(358) 评论(0) 推荐(0) 编辑

新人优惠服务器