- 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
推薦閱讀
- HTML5移動Web開發技術
- Java面向對象思想與程序設計
- PHP 編程從入門到實踐
- jQuery從入門到精通 (軟件開發視頻大講堂)
- Hands-On GPU:Accelerated Computer Vision with OpenCV and CUDA
- RabbitMQ Cookbook
- Python語言實用教程
- Programming with CodeIgniterMVC
- Spring技術內幕:深入解析Spring架構與設計原理(第2版)
- Django Design Patterns and Best Practices
- JQuery風暴:完美用戶體驗
- Docker:容器與容器云(第2版)
- Microsoft Exchange Server 2016 PowerShell Cookbook(Fourth Edition)
- R語言實戰(第2版)
- Java程序設計(項目教學版)