[Django]-Django rest framework: How to change error response format globally

3👍

If you want to change all of them, you should override the field’s default messages somewhere in the application initialization:

serializers.CharField.default_error_messages['blank'] = 'This field may not be blank'

For example, the blank message can be found here

4👍

You can use Restframework’s exception handler. Please have a look.

Leave a comment