Merge branch 'master' of github.com:mitsuhiko/flask
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents 2a81c8a, ea77d5e · Browse files · 5 files·+13 added−17 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+13 added−17 removed
- other:+13 added−17 removed
Provenance
- Commit
9c00f8b- Tree
9f12b8a- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
2a81c8a- Parent 2
ea77d5e
5 files changed+13 added−17 removed
modified:docs/patterns/fabric.rst+5 added-5 removed
30 unmodified lines31 hosts. These hosts can be defined either in the fabfile or on the command32 line. In this case we will add them to the fabfile.33 34 This is a basic first example that has the ability to upload the current35-sourcecode to the server and install it into a already existing35+sourcecode to the server and install it into a pre-existing36 virtual environment::37 38 from fabric.api import *39 12 unmodified lines52 # upload the source tarball to the temporary folder on the server53 put('dist/%s.tar.gz' % dist, '/tmp/yourapplication.tar.gz')54 # create a place where we can unzip the tarball, then enter55 # that directory and unzip it56- run('mkdir yourapplication')56+ run('mkdir /tmp/yourapplication')57 with cd('/tmp/yourapplication'):58 run('tar xzf /tmp/yourapplication.tar.gz')59- # now setup the package with our virtual environment's60- # python interpreter61- run('/var/www/yourapplication/env/bin/python setup.py install')59+ # now setup the package with our virtual environment's60+ # python interpreter61+ run('/var/www/yourapplication/env/bin/python setup.py install')62 # now that all is set up, delete the folder again63 run('rm -rf /tmp/yourapplication /tmp/yourapplication.tar.gz')64 # and finally touch the .wsgi file so that mod_wsgi triggers65 # a reload of the application131 unmodified linesmodified:docs/patterns/packages.rst+1 added-1 removed
55 unmodified lines56 `__name__` variable will resolve to the correct package.57 2. all the view functions (the ones with a :meth:`~flask.Flask.route`58 decorator on top) have to be imported when in the `__init__.py` file.59 Not the object itself, but the module it is in. Import the view module60- *after the application object is created*.60+ **after the application object is created**.61 62 Here's an example `__init__.py`::63 64 from flask import Flask225 unmodified linesmodified:docs/quickstart.rst+5 added
111 unmodified lines112 :align: center113 :class: screenshot114 :alt: screenshot of debugger in action115 116+.. admonition:: Working With Other Debuggers117 118+ Debuggers interfere with each other. If you are using another debugger119+ (e.g. PyDev or IntelliJ), you may need to set ``app.debug = False``.120+121+122 Routing123 -------124 125 Modern web applications have beautiful URLs. This helps people remember625 unmodified linesmodified:flask/app.py-9 removed
926 unmodified lines927 do_something_with(request)928 finally:929 ctx.pop()930 931- The big advantage of this approach is that you can use it without932- the try/finally statement in a shell for interactive testing:933-934- >>> ctx = app.test_request_context()935- >>> ctx.bind()936- >>> request.path937- u'/'938- >>> ctx.unbind()939-931 .. versionchanged:: 0.3932 Added support for non-with statement usage and `with` statement933 is now passed the ctx object.934 74 unmodified linesmodified:flask/config.py+2 added-2 removed
139 unmodified lines140 - an actual object reference: that object is used directly141 142 Objects are usually either modules or classes.143 144- Just the uppercase variables in that object are stored in the config145- after lowercasing. Example usage::144+ Just the uppercase variables in that object are stored in the config.145+ Example usage::146 147 app.config.from_object('yourapplication.default_config')148 from yourapplication import default_config149 app.config.from_object(default_config)16 unmodified lines