官术网_书友最值得收藏!

Chapter 2.  Working with Class-Based Views and Hyperlinked APIs in Django

In this chapter, we will expand the capabilities of the RESTful API that we started in the previous chapter. We will change the ORM settings to work with a more powerful PostgreSQL database and we will take advantage of the advanced features included in Django REST Framework that allow us to reduce the boilerplate code for complex APIs, such as class-based views. We will:

  • Use model serializers to eliminate duplicate code
  • Work with wrappers to write API views
  • Use the default parsing and rendering options and move beyond JSON
  • Browse the API
  • Design a RESTful API to interact with a complex PostgreSQL database
  • Understand the tasks performed by each HTTP method
  • Declare relationships with the models
  • Manage serialization and deserialization with relationships and hyperlinks
  • Create class based views and use generic classes
  • Work with endpoints for the API
  • Create and retrieve related resources
主站蜘蛛池模板: 邳州市| 广宗县| 大余县| 耿马| 永春县| 九龙县| 新疆| 上饶市| 武功县| 宁晋县| 正镶白旗| 安乡县| 昭觉县| 连城县| 青川县| 松潘县| 河池市| 新龙县| 南宁市| 永福县| 大田县| 岳阳市| 北安市| 巴彦淖尔市| 西乌珠穆沁旗| 南安市| 武冈市| 西昌市| 盐山县| 香河县| 页游| 甘德县| 吐鲁番市| 射洪县| 新建县| 苏州市| 吐鲁番市| 广昌县| 抚州市| 沙雅县| 蒙阴县|