Standardised JSON response from views
问题 When my page POSTs a form to my Django view, the view returns a response with some data but soon I ran into the issue that my views returned data in different formats and different sets of information. I've thought of using JSON as a standard format to return my data. There are two types of statuses, success and failure . When the POST was successful, it just returns success but when it has failed, it returns a sub group called errors which contains a of fields and that field's error. Here's