Use the `to_nice_json` jinja2 filter.