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

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
主站蜘蛛池模板: 大新县| 湟中县| 安多县| 庆元县| 阜新市| 维西| 勐海县| 鹤山市| 吉木乃县| 凌云县| 四平市| 鄄城县| 枣强县| 佛山市| 丘北县| 额尔古纳市| 昭通市| 阳江市| 日喀则市| 汉川市| 庆阳市| 富蕴县| 沁水县| 抚州市| 会昌县| 镇雄县| 大洼县| 洮南市| 曲阳县| 绥滨县| 呼和浩特市| 东兰县| 上思县| 监利县| 抚远县| 景宁| 玛沁县| 青岛市| 平山县| 合作市| 桂东县|