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

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
主站蜘蛛池模板: 南川市| 天津市| 崇州市| 浦江县| 黄浦区| 乌拉特中旗| 乌兰县| 东海县| 深圳市| 汾西县| 会东县| 通海县| 新巴尔虎左旗| 望都县| 嘉黎县| 昆山市| 望都县| 四川省| 靖边县| 双牌县| 皮山县| 汤阴县| 鹿泉市| 金坛市| 小金县| 化隆| 乌拉特中旗| 湛江市| 叶城县| 张家港市| 景宁| 沂源县| 洛川县| 英德市| 南溪县| 即墨市| 武威市| 郓城县| 牙克石市| 留坝县| 聊城市|