目前,当我的用户注册并出现错误时,我会收到以下消息:
status 400
{"username":["This field is required."],"email":["A user is already registered with this e-mail address."],"__all__":["You must type the same password each time."]}
这是针对我的移动应用程序的,我希望在返回错误时得到一致的消息(不是特定于字段的,如“用户名”、“电子邮件”)。例如,
status 400
{"error_message":"username - This field is required. email - A user is already registered with this e-mail address. __all__ - You must type the same password each time."}
无论如何我可以扩展注册/视图/注册类吗?