摘要: [toc] # 一 路由Routers 路由写法有多种 ```python - 1. 原始写法: path('books/', BookView.as_view()) - 2. 映射的写法:path('books/', BookView.as_view({'get': 'list', 'post': 阅读全文
posted @ 2023-05-24 22:36 星空看海 阅读(11) 评论(0) 推荐(0) 编辑
摘要: [toc] # 一 视图之两个视图基类 两个视图基类有: ```python # 视图类: -APIView:之前用过 -GenericAPIView:GenericAPIView继承了APIView ``` ## 1.1 APIView ```python rest_framework.views 阅读全文
posted @ 2023-05-24 22:33 星空看海 阅读(29) 评论(0) 推荐(1) 编辑