一.models.py中 from django.db import models class UserModel(models.Model) user_name = models.CharField() class MyModel(models.Model) author = models.Foreignkey(user) age = models.CharField() 二. 序列化文件 serializers.py 中创建序列化类 from rest_framework.serialize…