Working with Advanced Relationships and Serialization

In this chapter, we will create a complex RESTful Web Service that will persist data in a PostgreSQL database. We will work with different types of relationships between the resources and we will take advantage of generic classes and generic views provided by the Django REST framework to reduce the amount of boilerplate code. We will gain an understanding of:

  • Defining the requirements for a complex RESTful Web Service
  • Creating a new app with Django
  • Configuring a new web service
  • Defining many-to-one relationships with models.ForeignKey
  • Installing PostgreSQL
  • Running migrations that generate relationships
  • Analyzing the database
  • Configuring serialization and deserialization with relationships
  • Defining hyperlinks with serializers.HyperlinkedModelSerializer
  • Working with class-based views
  • Taking advantage of generic classes and generic views
  • Generalizing and mixing behavior
  • Working with routing and endpoints
  • Making requests that interact with resources that have relationships
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.214.27