Skip to content
Myr

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

5 files+13 added−17 removed

modified:docs/patterns/fabric.rst+5 added-5 removed
30 unmodified lines
31hosts. These hosts can be defined either in the fabfile or on the command32line. In this case we will add them to the fabfile.3334This is a basic first example that has the ability to upload the current35sourcecode to the server and install it into a already existing35sourcecode to the server and install it into a pre-existing36virtual environment::3738 from fabric.api import *39
12 unmodified lines
52 # 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 application
131 unmodified lines
modified:docs/patterns/packages.rst+1 added-1 removed
55 unmodified lines
56 `__name__` variable will resolve to the correct package.572. 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**.6162Here's an example `__init__.py`::6364 from flask import Flask
225 unmodified lines
modified:docs/quickstart.rst+5 added
111 unmodified lines
112 :align: center113 :class: screenshot114 :alt: screenshot of debugger in action115116.. admonition:: Working With Other Debuggers117118 Debuggers interfere with each other. If you are using another debugger119 (e.g. PyDev or IntelliJ), you may need to set ``app.debug = False``.120121122Routing123-------124125Modern web applications have beautiful URLs. This helps people remember
625 unmodified lines
modified:flask/app.py-9 removed
926 unmodified lines
927 do_something_with(request)928 finally:929 ctx.pop()930931 The big advantage of this approach is that you can use it without932 the try/finally statement in a shell for interactive testing:933934 >>> ctx = app.test_request_context()935 >>> ctx.bind()936 >>> request.path937 u'/'938 >>> ctx.unbind()939931 .. versionchanged:: 0.3932 Added support for non-with statement usage and `with` statement933 is now passed the ctx object.934
74 unmodified lines
modified:flask/config.py+2 added-2 removed
139 unmodified lines
140 - an actual object reference: that object is used directly141142 Objects are usually either modules or classes.143144 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::146147 app.config.from_object('yourapplication.default_config')148 from yourapplication import default_config149 app.config.from_object(default_config)
16 unmodified lines