Overview#
In the following article, I confirmed the basic operations of Django REST framework JSON:API (DJA).
In this article, I will try adding a custom model to DJA.
References#
I will add a UserInfo model, referencing the following article.
https://tech-blog.rakus.co.jp/entry/20220329/python
Steps#
Define the Model#
Add the following:
Build the Database#
Execute the following:
For reference, the following file is created:
Create Components#
Serializer#
Add the following:
ViewSets#
Define the View class.
Router#
Add the following:
Results#
Accessing http://localhost:8000/ shows that user-info has been created.

The list was also retrievable at http://localhost:8000/user-info.

Summary#
We hope this serves as a useful reference for using DJA.