摘要:
当一个视图有list、create、retrieve、update、destroy所有的功能,路由组件可以用DRF自带的routers简写 项目总路由:pro/urls.py from django.contrib import admin from django.urls import path, 阅读全文
摘要:
当一个视图有list、create、retrieve、update、destroy所有的功能,路由组件可以用DRF自带的routers简写 项目总路由:pro/urls.py from django.contrib import admin from django.urls import path, 阅读全文
摘要:
APIView与View区别:重写as_view(): csrf_token豁免重写dispatch(): 封装原生request在Request类的对象里,request.GET变成request.query_paramsrequest.POST变成request.data(注意不是seriali 阅读全文
|