Merge pull request #3199 from alecbrooks/master
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fix various small spelling errors.
authored by David Lord · committed by GitHub · parents 7f782ba, 4e272fc · Browse files · 9 files·+14 added−14 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+14 added−14 removed
- other:+14 added−14 removed
Provenance
- Commit
ded0f68- Tree
12eef1c- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
7f782ba- Parent 2
4e272fc
9 files changed+14 added−14 removed
modified:docs/appcontext.rst+1 added-1 removed
47 unmodified lines48 Typically, an application context will have the same lifetime as a49 request.50 51 See :doc:`/reqcontext` for more information about how the contexts work52-and the full lifecycle of a request.52+and the full life cycle of a request.53 54 55 Manually Push a Context56 -----------------------103 unmodified linesmodified:docs/becomingbig.rst+1 added-1 removed
94 unmodified lines95 ---------------------------96 97 The Flask developers keep the framework accessible to users with codebases big98 and small. If you find an obstacle in your way, caused by Flask, don't hesitate99-to contact the developers on the mailinglist or IRC channel. The best way for99+to contact the developers on the mailing list or IRC channel. The best way for100 the Flask and Flask extension developers to improve the tools for larger101 applications is getting feedback from users.modified:docs/blueprints.rst+2 added-2 removed
242 unmodified lines243 244 Error Handlers245 --------------246 247-Blueprints support the errorhandler decorator just like the :class:`Flask`247+Blueprints support the ``errorhandler`` decorator just like the :class:`Flask`248 application object, so it is easy to make Blueprint-specific custom error249 pages.250 251 Here is an example for a "404 Page Not Found" exception::6 unmodified lines258 concerning handlers for 404 and 405 exceptions. These errorhandlers are only259 invoked from an appropriate ``raise`` statement or a call to ``abort`` in another260 of the blueprint's view functions; they are not invoked by, e.g., an invalid URL261 access. This is because the blueprint does not "own" a certain URL space, so262-the application instance has no way of knowing which blueprint errorhandler it262+the application instance has no way of knowing which blueprint error handler it263 should run if given an invalid URL. If you would like to execute different264 handling strategies for these errors based on URL prefixes, they may be defined265 at the application level using the ``request`` proxy object::266 9 unmodified linesmodified:docs/config.rst+3 added-3 removed
7 unmodified lines8 toggling the debug mode, setting the secret key, and other such9 environment-specific things.10 11 The way Flask is designed usually requires the configuration to be12-available when the application starts up. You can hardcode the12+available when the application starts up. You can hard code the13 configuration in the code, which for many small applications is not14 actually that bad, but there are better ways.15 16 Independent of how you load your config, there is a config object476 unmodified lines493 that experience:494 495 1. Create your application in a function and register blueprints on it.496 That way you can create multiple instances of your application with497- different configurations attached which makes unittesting a lot497+ different configurations attached which makes unit testing a lot498 easier. You can use this to pass in configuration as needed.499 500 2. Do not write code that needs the configuration at import time. If you501 limit yourself to request-only accesses to the configuration you can24 unmodified lines526 the config file by adding ``from yourapplication.default_settings527 import *`` to the top of the file and then overriding the changes by hand.528 You could also inspect an environment variable like529 ``YOURAPPLICATION_MODE`` and set that to `production`, `development` etc530-and import different hardcoded files based on that.530+and import different hard-coded files based on that.531 532 An interesting pattern is also to use classes and inheritance for533 configuration::534 160 unmodified linesmodified:docs/design.rst+2 added-2 removed
39 unmodified lines40 the time. There are ways to fake multiple applications with a single41 application object, like maintaining a stack of applications, but this42 causes some problems I won't outline here in detail. Now the question is:43 when does a microframework need more than one application at the same44-time? A good example for this is unittesting. When you want to test44+time? A good example for this is unit testing. When you want to test45 something it can be very helpful to create a minimal application to test46 specific behavior. When the application object is deleted everything it47 allocated will be freed again.48 26 unmodified lines75 there are better ways to do that so that you do not lose the reference76 to the application object :meth:`~flask.Flask.wsgi_app`).77 78 Furthermore this design makes it possible to use a factory function to79-create the application which is very helpful for unittesting and similar79+create the application which is very helpful for unit testing and similar80 things (:ref:`app-factories`).81 82 The Routing System83 ------------------108 unmodified linesmodified:docs/extensiondev.rst+1 added-1 removed
285 unmodified lines286 also avoids having multiple developers working in isolation on pretty much the287 same problem.288 289 Remember: good API design is hard, so introduce your project on the290-mailinglist, and let other developers give you a helping hand with290+mailing list, and let other developers give you a helping hand with291 designing the API.292 293 The best Flask extensions are extensions that share common idioms for the294 API. And this can only work if collaboration happens early.51 unmodified linesmodified:docs/extensions.rst+1 added-1 removed
4 unmodified lines5 6 Extensions are extra packages that add functionality to a Flask7 application. For example, an extension might add support for sending8 email or connecting to a database. Some extensions add entire new9-frameworks to help build certain types of applications, like a ReST API.9+frameworks to help build certain types of applications, like a REST API.10 11 12 Finding Extensions13 ------------------40 unmodified linesmodified:docs/shell.rst+1 added-1 removed
18 unmodified lines19 can you do?20 21 This is where some helper functions come in handy. Keep in mind however22 that these functions are not only there for interactive shell usage, but23-also for unittesting and other situations that require a faked request23+also for unit testing and other situations that require a faked request24 context.25 26 Generally it's recommended that you read the :ref:`request-context`27 chapter of the documentation first.76 unmodified linesmodified:docs/unicode.rst+2 added-2 removed
41 unmodified lines42 43 So the rule of thumb: if you are not dealing with binary data, work with44 Unicode. What does working with Unicode in Python 2.x mean?45 46-- as long as you are using ASCII charpoints only (basically numbers,47- some special characters of latin letters without umlauts or anything46+- as long as you are using ASCII code points only (basically numbers,47+ some special characters of Latin letters without umlauts or anything48 fancy) you can use regular string literals (``'Hello World'``).49 - if you need anything else than ASCII in a string you have to mark50 this string as Unicode string by prefixing it with a lowercase `u`.51 (like ``u'Hänsel und Gretel'``)56 unmodified lines