- 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動畫與游戲編程
- Node.js Design Patterns
- 機器學習系統:設計和實現
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Unity 2020 Mobile Game Development
- Mastering Julia
- INSTANT Passbook App Development for iOS How-to
- Android Wear Projects
- Python算法詳解
- IBM Cognos Business Intelligence 10.1 Dashboarding cookbook
- Java零基礎實戰
- Visual C#.NET Web應用程序設計
- Building Wireless Sensor Networks Using Arduino
- Python程序設計與算法基礎教程(第2版)(微課版)
- Learning Material Design