Fixed some minor typos throughout docs.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Ron DuPlain · committed by Armin Ronacher · parent e409bc7 · Browse files · 5 files·+17 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+17 added−17 removed
- other:+17 added−17 removed
Provenance
- Commit
93a8ca0- Tree
a530952- Author
Ron DuPlain <ron.duplain@gmail.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
e409bc7
5 files changed+17 added−17 removed
modified:docs/becomingbig.rst+2 added-2 removed
23 unmodified lines24 In that case, it makes a lot of sense to use dotted names for the URL25 endpoints.26 27 Here are some suggestions for how Flask can be modified to better 28-accomodate large-scale applications:28+accommodate large-scale applications:29 30 - implement dotted names for URL endpoints31 - get rid of the decorator function registering which causes a lot32 of troubles for applications that have circular dependencies. It33 also requires that the whole application is imported when the system34 initializes or certain URLs will not be available right away. A35 better solution would be to have one module with all URLs in there and36- specifing the target functions explicitly or by name and importing36+ specifying the target functions explicitly or by name and importing37 them when needed.38 - switch to explicit request object passing. This requires more typing39 (because you now have something to pass around) but it makes it a40 whole lot easier to debug hairy situations and to test the code.17 unmodified linesmodified:docs/design.rst+3 added-3 removed
49 unmodified lines50 possible without hacks if the object were created ahead of time for you51 based on a class that is not exposed to you.52 53 But there is another very important reason why Flask depends on an54-explicit instanciation of that class: the package name. Whenever you54+explicit instantiation of that class: the package name. Whenever you55 create a Flask instance you usually pass it `__name__` as package name.56 Flask depends on that information to properly load resources relative57 to your module. With Python's outstanding support for reflection it can58 then access the package to figure out where the templates and static files65 unmodified lines124 125 Flask is a framework that takes advantage of the work already done by126 Werkzeug to properly interface WSGI (which can be a complex task at127 times). Thanks to recent developments in the Python package128-infrastructure, packages with depencencies are no longer an issue and128+infrastructure, packages with dependencies are no longer an issue and129 there are very few reasons against having libraries that depend on others.130 131 132 Thread Locals6 unmodified lines139 140 Yes it is usually not such a bright idea to use thread locals. They cause141 troubles for servers that are not based on the concept of threads and make142 large applications harder to maintain. However Flask is just not designed143-for large applications or asyncronous servers. Flask wants to make it143+for large applications or asynchronous servers. Flask wants to make it144 quick and easy to write a traditional web application.145 146 Also see the :ref:`becomingbig` section of the documentation for some147 inspiration for larger applications based on Flask.modified:docs/foreword.rst+3 added-3 removed
66 unmodified lines67 up in situations where we think "well, this is just far fetched, how could68 that possibly be exploited" and then an intelligent guy comes along and69 figures a way out to exploit that application. And don't think, your70 application is not important enough for hackers to take notice. Depending71-ont he kind of attack, chances are there are automated botnets out there72-trying to figure out how to fill your database with viagra adverisments.71+on the kind of attack, chances are there are automated botnets out there72+trying to figure out how to fill your database with viagra advertisements.73 74 So always keep that in mind when doing web development.75 76 Target Audience77 ---------------78 79-Is Flask for you? Is your application small-ish (less than 4000 lines of79+Is Flask for you? If your application small-ish (less than 4000 lines of80 Python code) and does not depend on too complex database structures, Flask81 is the Framework for you. It was designed from the ground up to be easy82 to use, based on established principles, good intentions and on top of two83 established libraries in widespread usage.11 unmodified linesmodified:docs/installation.rst+1 added-1 removed
120 unmodified lines121 $ python setup.py develop122 ...123 Finished processing dependencies for Flask124 125-This will pull in the depdenencies and activate the git head as current125+This will pull in the dependencies and activate the git head as current126 version. Then you just have to ``git pull origin`` to get the latest127 version.128 129 To just get the development version without git, do this instead::44 unmodified linesmodified:docs/quickstart.rst+8 added-8 removed
81 unmodified lines82 you enable the debug support the server will reload itself on code changes83 and also provide you with a helpful debugger if things go wrong.84 85 There are two ways to enable debugging. Either set that flag on the86-applciation object::86+application object::87 88 app.debug = True89 app.run()90 47 unmodified lines138 likely he will like the page and come back next time.139 140 To add variable parts to a URL you can mark these special sections as141 ``<variable_name>``. Such a part is then passed as keyword argument to142-your function. Optionally a converter can be specifed by specifying a142+your function. Optionally a converter can be specified by specifying a143 rule with ``<converter:variable_name>``. Here some nice examples::144 145 @app.route('/user/<username>')146 def show_user_profile(username):38 unmodified lines185 ... 186 >>> with app.test_request_context():187 ... print url_for('index')188 ... print url_for('login')189-... print url_for('profile', username='John Doe')189 ... print url_for('login', next='/')190+... print url_for('profile', username='John Doe')191 ... 192 /193 /login194 /login?next=/123 unmodified lines318 return render_template('hello.html', name=name)319 320 Flask will look for templates in the `templates` folder. So if your321 application is a module, that folder is next to that module, if it's a322-pacakge it's actually inside your package:322+package it's actually inside your package:323 324 **Case 1**: a module::325 326 /application.py156 unmodified lines483 We recommend accessing URL parameters with `get` or by catching the484 `KeyError` because users might change the URL and presenting them a 400485 bad request page in that case is a bit user unfriendly.486 487-For a full list of methods and attribtues on that object, head over to the487+For a full list of methods and attributes on that object, head over to the488 :class:`~flask.request` documentation.489 490 491 File Uploads492 ````````````493 494 Obviously you can handle uploaded files with Flask just as easy. Just495 make sure not to forget to set the ``enctype="multipart/form-data"``496-attribtue on your HTML form, otherwise the browser will not transmit your496+attribute on your HTML form, otherwise the browser will not transmit your497 files at all.498 499 Uploaded files are stored in memory or at a temporary location on the500 filesystem. You can access those files by looking at the74 unmodified lines575 return render_template('page_not_found.html'), 404576 577 Note the ``404`` after the :func:`~flask.render_template` call. This578 tells Flask that the status code of that page should be 404 which means579-not found. By default 200 is assumed which translats to: all went well.579+not found. By default 200 is assumed which translates to: all went well.580 581 .. _sessions:582 583 Sessions1 unmodified line585 586 Besides the request object there is also a second object called587 :class:`~flask.session` that allows you to store information specific to a588 user from one request to the next. This is implemented on top of cookies589-for you and signes the cookies cryptographically. What this means is that589+for you and signs the cookies cryptographically. What this means is that590 the user could look at the contents of your cookie but not modify it,591 unless he knows the secret key used for signing.592 593 In order to use sessions you have to set a secret key. Here is how48 unmodified lines