Browse Source

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

pull/232/merge
Armin Ronacher 14 years ago
parent
commit
9c00f8b787
  1. 4
      docs/patterns/fabric.rst
  2. 2
      docs/patterns/packages.rst
  3. 5
      docs/quickstart.rst
  4. 9
      flask/app.py
  5. 4
      flask/config.py

4
docs/patterns/fabric.rst

@ -32,7 +32,7 @@ hosts. These hosts can be defined either in the fabfile or on the command
line. In this case we will add them to the fabfile. line. In this case we will add them to the fabfile.
This is a basic first example that has the ability to upload the current This is a basic first example that has the ability to upload the current
sourcecode to the server and install it into a already existing sourcecode to the server and install it into a pre-existing
virtual environment:: virtual environment::
from fabric.api import * from fabric.api import *
@ -53,7 +53,7 @@ virtual environment::
put('dist/%s.tar.gz' % dist, '/tmp/yourapplication.tar.gz') put('dist/%s.tar.gz' % dist, '/tmp/yourapplication.tar.gz')
# create a place where we can unzip the tarball, then enter # create a place where we can unzip the tarball, then enter
# that directory and unzip it # that directory and unzip it
run('mkdir yourapplication') run('mkdir /tmp/yourapplication')
with cd('/tmp/yourapplication'): with cd('/tmp/yourapplication'):
run('tar xzf /tmp/yourapplication.tar.gz') run('tar xzf /tmp/yourapplication.tar.gz')
# now setup the package with our virtual environment's # now setup the package with our virtual environment's

2
docs/patterns/packages.rst

@ -57,7 +57,7 @@ following quick checklist:
2. all the view functions (the ones with a :meth:`~flask.Flask.route` 2. all the view functions (the ones with a :meth:`~flask.Flask.route`
decorator on top) have to be imported when in the `__init__.py` file. decorator on top) have to be imported when in the `__init__.py` file.
Not the object itself, but the module it is in. Import the view module Not the object itself, but the module it is in. Import the view module
*after the application object is created*. **after the application object is created**.
Here's an example `__init__.py`:: Here's an example `__init__.py`::

5
docs/quickstart.rst

@ -113,6 +113,11 @@ Screenshot of the debugger in action:
:class: screenshot :class: screenshot
:alt: screenshot of debugger in action :alt: screenshot of debugger in action
.. admonition:: Working With Other Debuggers
Debuggers interfere with each other. If you are using another debugger
(e.g. PyDev or IntelliJ), you may need to set ``app.debug = False``.
Routing Routing
------- -------

9
flask/app.py

@ -928,15 +928,6 @@ class Flask(_PackageBoundObject):
finally: finally:
ctx.pop() ctx.pop()
The big advantage of this approach is that you can use it without
the try/finally statement in a shell for interactive testing:
>>> ctx = app.test_request_context()
>>> ctx.bind()
>>> request.path
u'/'
>>> ctx.unbind()
.. versionchanged:: 0.3 .. versionchanged:: 0.3
Added support for non-with statement usage and `with` statement Added support for non-with statement usage and `with` statement
is now passed the ctx object. is now passed the ctx object.

4
flask/config.py

@ -141,8 +141,8 @@ class Config(dict):
Objects are usually either modules or classes. Objects are usually either modules or classes.
Just the uppercase variables in that object are stored in the config Just the uppercase variables in that object are stored in the config.
after lowercasing. Example usage:: Example usage::
app.config.from_object('yourapplication.default_config') app.config.from_object('yourapplication.default_config')
from yourapplication import default_config from yourapplication import default_config

Loading…
Cancel
Save