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

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
主站蜘蛛池模板: 福贡县| 定结县| 大足县| 格尔木市| 永嘉县| 茶陵县| 喜德县| 新野县| 神池县| 丹棱县| 长春市| 安西县| 滨州市| 仙游县| 洛浦县| 饶平县| 邯郸市| 新丰县| 张掖市| 南乐县| 天峻县| 黑河市| 邛崃市| 化德县| 瑞昌市| 大足县| 神木县| 泽州县| 浦东新区| 华容县| 丘北县| 东城区| 汝阳县| 沙河市| 朝阳县| 红河县| 屏山县| 潮安县| 哈尔滨市| 敦化市| 宜春市|