forked from orbit-oss/flask
Merge branch 'master' of github.com:mitsuhiko/flask
This commit is contained in:
commit
6a621440ef
9 changed files with 26 additions and 11 deletions
|
|
@ -64,6 +64,6 @@ compatible Python code
|
|||
<http://lucumr.pocoo.org/2011/1/22/forwards-compatible-python/>`_.
|
||||
|
||||
If you do want to dive into Python 3 already have a look at the
|
||||
:ref:`python3_support` page.
|
||||
:ref:`python3-support` page.
|
||||
|
||||
Continue to :ref:`installation` or the :ref:`quickstart`.
|
||||
|
|
|
|||
|
|
@ -365,12 +365,12 @@ You can instead just do this::
|
|||
from flask import json
|
||||
|
||||
For usage examples, read the :mod:`json` documentation in the standard
|
||||
lirbary. The following extensions are by default applied to the stdlib's
|
||||
library. The following extensions are by default applied to the stdlib's
|
||||
JSON module:
|
||||
|
||||
1. ``datetime`` objects are serialized as :rfc:`822` strings.
|
||||
2. Any object with an ``__html__`` method (like :class:`~flask.Markup`)
|
||||
will ahve that method called and then the return value is serialized
|
||||
will have that method called and then the return value is serialized
|
||||
as string.
|
||||
|
||||
The :func:`~htmlsafe_dumps` function of this json module is also available
|
||||
|
|
@ -505,7 +505,7 @@ Signals
|
|||
|
||||
.. data:: signals_available
|
||||
|
||||
`True` if the signalling system is available. This is the case
|
||||
`True` if the signaling system is available. This is the case
|
||||
when `blinker`_ is installed.
|
||||
|
||||
.. data:: template_rendered
|
||||
|
|
@ -728,7 +728,7 @@ some defaults to :meth:`~flask.Flask.add_url_rule` or general behavior:
|
|||
|
||||
- `required_methods`: if this attribute is set, Flask will always add
|
||||
these methods when registering a URL rule even if the methods were
|
||||
explicitly overriden in the ``route()`` call.
|
||||
explicitly overridden in the ``route()`` call.
|
||||
|
||||
Full example::
|
||||
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ Now the interesting part is that in HTML4 and XHTML1, the only methods a
|
|||
form can submit to the server are `GET` and `POST`. But with JavaScript
|
||||
and future HTML standards you can use the other methods as well. Furthermore
|
||||
HTTP has become quite popular lately and browsers are no longer the only
|
||||
clients that are using HTTP. For instance, many revision control system
|
||||
clients that are using HTTP. For instance, many revision control systems
|
||||
use it.
|
||||
|
||||
.. _HTTP RFC: http://www.ietf.org/rfc/rfc2068.txt
|
||||
|
|
@ -666,8 +666,8 @@ About Responses
|
|||
|
||||
The return value from a view function is automatically converted into a
|
||||
response object for you. If the return value is a string it's converted
|
||||
into a response object with the string as response body, an ``200 OK``
|
||||
error code and a ``text/html`` mimetype. The logic that Flask applies to
|
||||
into a response object with the string as response body, a ``200 OK``
|
||||
status code and a ``text/html`` mimetype. The logic that Flask applies to
|
||||
converting return values into response objects is as follows:
|
||||
|
||||
1. If a response object of the correct type is returned it's directly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue