diff --git a/README b/README index 56d57f88..5c0eb4f1 100644 --- a/README +++ b/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? diff --git a/docs/patterns/templateinheritance.rst b/docs/patterns/templateinheritance.rst index 8a1a306d..70015ecc 100644 --- a/docs/patterns/templateinheritance.rst +++ b/docs/patterns/templateinheritance.rst @@ -38,7 +38,7 @@ document that you might use for a simple two-column page. It's the job of 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 diff --git a/docs/tutorial/dbcon.rst b/docs/tutorial/dbcon.rst index b19cb14c..99391a27 100644 --- a/docs/tutorial/dbcon.rst +++ b/docs/tutorial/dbcon.rst @@ -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 `, it's a good idea not to. + +.. _example source: + http://github.com/mitsuhiko/flask/tree/master/examples/flaskr/ diff --git a/flask/app.py b/flask/app.py index 6a5a417b..5c448144 100644 --- a/flask/app.py +++ b/flask/app.py @@ -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 diff --git a/flask/helpers.py b/flask/helpers.py index f44a7f64..dff79f68 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -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)