《Django 5 By Example》阅读笔记:p645-p650
《Django 5 By Example》学习第 8 天,p645-p650 总结,总计 6 页。
一、技术总结
1.django-rest-framework
(1)serializer
p648, Serializer: Provides serialization for normal Python class instances。Serializer 又细分为 Serializer, ModelSerializer, HyperlinkedModelSerializer.
2.目录结构
引入 django-rest-framework 后,API 相关的代码放到 api 目录,如上所示。
二、英语总结(生词:2)
1.bookmark vs bookmarklet
(1)bookmark
c. a piece of thick paper, leather or plastic that you put betweent the pages of a book so that you can find a page again quickly(书签).
(2)bookmarklet
A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser(书签工具).
2.negotiation
p650, The framework determines which renderer to use through content negotiation by inspecting the request’s Accept header to determine the expected content type for the response.
(1)negotiate
neg-("not") + otium("ease, leisure"). 字面意思是"lack of leisure(空闲)",后来演变为"have formal discussions with someone in order to reach an agreement with them(协商)"之意。
三、其它
书上的项目太多了,我自己则是比较关心 django-rest-framework 的使用,因为这是实际工作中用得最多的。鉴于此,作者在第 15 章引入 django-rest-framework,所以直接跳到第 15 张开始学习。
四、参考资料
1. 编程
(1) Antonio Melé,《Django 5 By Example》:https://book.douban.com/subject/37007362/
2. 英语
(1) Etymology Dictionary:https://www.etymonline.com
(2) Cambridge Dictionary:https://dictionary.cambridge.org
欢迎搜索及关注:编程人(a_codists)
版权声明: 本文为 InfoQ 作者【codists】的原创文章。
原文链接:【http://xie.infoq.cn/article/fb5034b0bb5028e283f346045】。文章转载请联系作者。
评论