- Building RESTful Python Web Services
- Gastón C. Hillar
- 156字
- 2021-08-20 10:24:24
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
推薦閱讀
- 少兒人工智能趣味入門:Scratch 3.0動畫與游戲編程
- DevOps:軟件架構師行動指南
- Bootstrap Site Blueprints Volume II
- .NET之美:.NET關鍵技術深入解析
- JavaScript 從入門到項目實踐(超值版)
- Moodle Administration Essentials
- 面向STEM的Scratch創新課程
- 基于免疫進化的算法及應用研究
- Blockly創意趣味編程
- Web Application Development with MEAN
- Windows Server 2012 Unified Remote Access Planning and Deployment
- Oracle Database 12c Security Cookbook
- 深入淺出RxJS
- Swift 4 Protocol-Oriented Programming(Third Edition)
- Unity&VR游戲美術設計實戰