forked from orbit-oss/flask
remove simplejson
- remove encoding detection backport, json.loads supports it directly - use str.translate instead of multiple str.replace
This commit is contained in:
parent
024f0d384c
commit
c43edfc7c0
6 changed files with 27 additions and 113 deletions
19
docs/api.rst
19
docs/api.rst
|
|
@ -284,22 +284,9 @@ JSON Support
|
|||
|
||||
.. module:: flask.json
|
||||
|
||||
Flask uses ``simplejson`` for the JSON implementation. Since simplejson
|
||||
is provided by both the standard library as well as extension, Flask will
|
||||
try simplejson first and then fall back to the stdlib json module. On top
|
||||
of that it will delegate access to the current application's JSON encoders
|
||||
and decoders for easier customization.
|
||||
|
||||
So for starters instead of doing::
|
||||
|
||||
try:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
You can instead just do this::
|
||||
|
||||
from flask import json
|
||||
Flask uses the built-in :mod:`json` module for the JSON implementation.
|
||||
It will delegate access to the current application's JSON encoders and
|
||||
decoders for easier customization.
|
||||
|
||||
For usage examples, read the :mod:`json` documentation in the standard
|
||||
library. The following extensions are by default applied to the stdlib's
|
||||
|
|
|
|||
|
|
@ -39,16 +39,12 @@ These distributions will not be installed automatically. Flask will detect and
|
|||
use them if you install them.
|
||||
|
||||
* `Blinker`_ provides support for :doc:`signals`.
|
||||
* `SimpleJSON`_ is a fast JSON implementation that is compatible with
|
||||
Python's ``json`` module. It is preferred for JSON operations if it is
|
||||
installed.
|
||||
* `python-dotenv`_ enables support for :ref:`dotenv` when running ``flask``
|
||||
commands.
|
||||
* `Watchdog`_ provides a faster, more efficient reloader for the development
|
||||
server.
|
||||
|
||||
.. _Blinker: https://pythonhosted.org/blinker/
|
||||
.. _SimpleJSON: https://simplejson.readthedocs.io/
|
||||
.. _python-dotenv: https://github.com/theskumar/python-dotenv#readme
|
||||
.. _watchdog: https://pythonhosted.org/watchdog/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue