Browse Source

Merge branch 'master' of github.com:mitsuhiko/flask

pull/288/head
Armin Ronacher 14 years ago
parent
commit
79aa4ac14d
  1. 3
      README
  2. 2
      docs/patterns/templateinheritance.rst
  3. 16
      docs/tutorial/dbcon.rst
  4. 7
      flask/app.py
  5. 2
      flask/helpers.py

3
README

@ -1,4 +1,3 @@
// Flask // // Flask //
web development, one drop at a time web development, one drop at a time
@ -8,7 +7,7 @@
Flask is a microframework for Python based on Werkzeug Flask is a microframework for Python based on Werkzeug
and Jinja2. It's intended for small scale applications 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? ~ Is it ready?

2
docs/patterns/templateinheritance.rst

@ -38,7 +38,7 @@ document that you might use for a simple two-column page. It's the job of
</body> </body>
In this example, the ``{% block %}`` tags define four blocks that child templates 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 may override those portions of the template.
Child Template Child Template

16
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. the scenes to ensure it does the right thing.
Continue to :ref:`tutorial-views`. 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/

7
flask/app.py

@ -548,8 +548,9 @@ class Flask(_PackageBoundObject):
to have the server available externally as well. to have the server available externally as well.
:param port: the port of the webserver :param port: the port of the webserver
:param options: the options to be forwarded to the underlying :param options: the options to be forwarded to the underlying
Werkzeug server. See :func:`werkzeug.run_simple` Werkzeug server. See
for more information. :func:`werkzeug.serving.run_simple` for more
information.
""" """
from werkzeug.serving import run_simple from werkzeug.serving import run_simple
if 'debug' in options: if 'debug' in options:
@ -1264,7 +1265,7 @@ class Flask(_PackageBoundObject):
def test_request_context(self, *args, **kwargs): def test_request_context(self, *args, **kwargs):
"""Creates a WSGI environment from the given values (see """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). function accepts the same arguments).
""" """
from werkzeug.test import create_environ from werkzeug.test import create_environ

2
flask/helpers.py

@ -421,7 +421,7 @@ def safe_join(directory, filename):
:param directory: the base directory. :param directory: the base directory.
:param filename: the untrusted filename relative to that 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`. would fall out of `directory`.
""" """
filename = posixpath.normpath(filename) filename = posixpath.normpath(filename)

Loading…
Cancel
Save