Stay Hungry,Stay Foolish!

摘要: Relationships & Hyperlinked APIs https://www.django-rest-framework.org/tutorial/5-relationships-and-hyperlinked-apis/ 对于表之间的关联关系, ModelSerializer 默认是使 阅读全文
posted @ 2021-10-12 23:39 lightsong 阅读(32) 评论(0) 推荐(0) 编辑
摘要: Authentication & Permissions https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/ 对于view需要限制用户的访问权限, 例如认证 和 许可。 Currently 阅读全文
posted @ 2021-10-12 23:21 lightsong 阅读(47) 评论(0) 推荐(0) 编辑
摘要: Class-based Views https://www.django-rest-framework.org/tutorial/3-class-based-views/ APIView 继承于 django view类提供了 http method 方法的抽象, 即继承于此类的应用类中, 可以定义 阅读全文
posted @ 2021-10-12 22:30 lightsong 阅读(46) 评论(0) 推荐(0) 编辑
摘要: Requests and Responses https://www.django-rest-framework.org/tutorial/2-requests-and-responses/ Request 请求类,扩展了 httprequest类。 请求数据存储在 request.data 成员中 阅读全文
posted @ 2021-10-12 15:18 lightsong 阅读(29) 评论(0) 推荐(0) 编辑
摘要: Django REST framework Django 支持MTV模式, 前端渲染的内容,放在了后端 template中实施,包括获取数据,渲染模板一系列过程都在候选执行。 在前端能力强大的现在, 前后端分离开发模式已经成为主流, 所以后端只提供API, 于前端进行数据交互,成为业界主流。 此框架 阅读全文
posted @ 2021-10-12 15:06 lightsong 阅读(40) 评论(0) 推荐(0) 编辑
Life Is Short, We Need Ship To Travel