  If for some reason you don't want to use client-side escaping, you can also
  set ``escape_html=True`` and error messages will be escaped so you can use them
  directly in HTML.
  
  .. method:: Form.add_error(field, error)
  
  This method allows adding errors to specific fields from within the
  ``Form.clean()`` method, or from outside the form altogether; for instance
  from a view.
  
 
</s> remove         errors = json.loads(form.errors.as_json())
 </s> add         errors = form.errors.get_json_data() </s> remove         return json.dumps({f: e.get_json_data(escape_html) for f, e in self.items()})
 </s> add         return json.dumps(self.get_json_data(escape_html))
.. method:: Form.errors.get_json_data(escape_html=False)

.. versionadded:: 2.0

Returns the errors as a dictionary suitable for serializing to JSON.
:meth:`Form.errors.as_json()` returns serialized JSON, while this returns the
error data before it's serialized.

The ``escape_html`` parameter behaves as described in
:meth:`Form.errors.as_json()`.

  If for some reason you don't want to use client-side escaping, you can also
  set ``escape_html=True`` and error messages will be escaped so you can use them
  directly in HTML.
  
.. method:: Form.errors.get_json_data(escape_html=False)

.. versionadded:: 2.0

Returns the errors as a dictionary suitable for serializing to JSON.
:meth:`Form.errors.as_json()` returns serialized JSON, while this returns the
error data before it's serialized.

The ``escape_html`` parameter behaves as described in
:meth:`Form.errors.as_json()`.

  .. method:: Form.add_error(field, error)
  
  This method allows adding errors to specific fields from within the
  ``Form.clean()`` method, or from outside the form altogether; for instance
  from a view.
  
keep keep keep add keep keep keep keep keep keep
 Fixed #27922 -- Added ErrorDict.get_json_data(). 
docs/ref/forms/api.txt