欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 锐评 > 《Django 5 By Example》阅读笔记:p645-p650

《Django 5 By Example》阅读笔记:p645-p650

2025/2/24 9:30:19 来源:https://blog.csdn.net/codists/article/details/143869778  浏览:    关键词:《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.目录结构

.courses├── __init__.py├── admin.py├── api│  ├── __init__.py│  ├── serializer.py│  └── views.py├── apps.py├── fields.py├── fixtures│  └── subjects.json├── forms.py├── migrations│  ├── 0001_initial.py│  ├── 0002_video_text_image_file_content.py│  ├── 0003_alter_content_options_alter_module_options_and_more.py│  ├── 0004_course_students.py│  └── __init__.py├── models.py├── output.txt├── static│  └── css├── templates│  ├── base.html│  ├── courses│  └── registration├── templatetags│  ├── __init__.py│  └── course.py├── tests.py├── urls.py└── views.py

引入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)

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词