在rest_framework官方文档ModelSerializer部分看到这样一句话:Alternatively names in the fields options can map to properties or methods which take no arguments that exist on the model class.
We’ll assume you are using SSH keys for authentication. To set up SSH agent to avoid retyping passwords, you can do: $ ssh-agent bash$ ssh-add ~/.ssh/id_rsa