- 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
推薦閱讀
- Puppet 4 Essentials(Second Edition)
- Android開發精要
- Java Web開發之道
- TypeScript圖形渲染實戰:基于WebGL的3D架構與實現
- C++程序設計基礎教程
- Learning Nessus for Penetration Testing
- Flask Web開發:基于Python的Web應用開發實戰(第2版)
- Java程序設計教程
- Mastering Object:Oriented Python(Second Edition)
- Beginning C# 7 Hands-On:The Core Language
- Extending Docker
- Bitcoin Essentials
- C語言王者歸來
- 亮劍C#項目開發案例導航
- Salt Cookbook