forked from orbit-oss/flask
Merge branch 'master' of github.com:mitsuhiko/flask
This commit is contained in:
commit
79aa4ac14d
5 changed files with 23 additions and 7 deletions
3
README
3
README
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
// Flask //
|
||||
|
||||
web development, one drop at a time
|
||||
|
|
@ -8,7 +7,7 @@
|
|||
|
||||
Flask is a microframework for Python based on Werkzeug
|
||||
and Jinja2. It's intended for small scale applications
|
||||
and was developped with best intentions in mind.
|
||||
and was developed with best intentions in mind.
|
||||
|
||||
~ Is it ready?
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ document that you might use for a simple two-column page. It's the job of
|
|||
</body>
|
||||
|
||||
In this example, the ``{% block %}`` tags define four blocks that child templates
|
||||
can fill in. All the `block` tag does is to tell the template engine that a
|
||||
can fill in. All the `block` tag does is tell the template engine that a
|
||||
child template may override those portions of the template.
|
||||
|
||||
Child Template
|
||||
|
|
|
|||
|
|
@ -39,3 +39,19 @@ environments. That special :data:`~flask.g` object does some magic behind
|
|||
the scenes to ensure it does the right thing.
|
||||
|
||||
Continue to :ref:`tutorial-views`.
|
||||
|
||||
.. hint:: Where do I put this code?
|
||||
|
||||
If you've been following along in this tutorial, you might be wondering
|
||||
where to put the code from this step and the next. A logical place is to
|
||||
group these module-level functions together, and put your new
|
||||
``before_request`` and ``teardown_request`` functions below your existing
|
||||
``init_db`` function (following the tutorial line-by-line).
|
||||
|
||||
If you need a moment to find your bearings, take a look at how the `example
|
||||
source`_ is organized. In Flask, you can put all of your application code
|
||||
into a single Python module. You don't have to, and if your app :ref:`grows
|
||||
larger <larger-applications>`, it's a good idea not to.
|
||||
|
||||
.. _example source:
|
||||
http://github.com/mitsuhiko/flask/tree/master/examples/flaskr/
|
||||
|
|
|
|||
|
|
@ -548,8 +548,9 @@ class Flask(_PackageBoundObject):
|
|||
to have the server available externally as well.
|
||||
:param port: the port of the webserver
|
||||
:param options: the options to be forwarded to the underlying
|
||||
Werkzeug server. See :func:`werkzeug.run_simple`
|
||||
for more information.
|
||||
Werkzeug server. See
|
||||
:func:`werkzeug.serving.run_simple` for more
|
||||
information.
|
||||
"""
|
||||
from werkzeug.serving import run_simple
|
||||
if 'debug' in options:
|
||||
|
|
@ -1264,7 +1265,7 @@ class Flask(_PackageBoundObject):
|
|||
|
||||
def test_request_context(self, *args, **kwargs):
|
||||
"""Creates a WSGI environment from the given values (see
|
||||
:func:`werkzeug.create_environ` for more information, this
|
||||
:func:`werkzeug.test.EnvironBuilder` for more information, this
|
||||
function accepts the same arguments).
|
||||
"""
|
||||
from werkzeug.test import create_environ
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ def safe_join(directory, filename):
|
|||
|
||||
:param directory: the base directory.
|
||||
:param filename: the untrusted filename relative to that directory.
|
||||
:raises: :class:`~werkzeug.exceptions.NotFound` if the retsulting path
|
||||
:raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path
|
||||
would fall out of `directory`.
|
||||
"""
|
||||
filename = posixpath.normpath(filename)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue