Fixed small typos in docs. Added a cross-ref.
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 216478f · Browse files · 19 files·+27 added−27 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
19 files+27 added−27 removed
- other:+27 added−27 removed
Provenance
- Commit
6875a05- Tree
3ff24fc- Author
Ron DuPlain <ron.duplain@gmail.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
216478f
19 files changed+27 added−27 removed
modified:docs/deploying/cgi.rst+1 added-1 removed
36 unmodified lines37 Server Setup38 ------------39 40 Usually there are two ways to configure the server. Either just copy the41-`.cgi` into a `cgi-bin` (and use `mod_rerwite` or something similar to41+`.cgi` into a `cgi-bin` (and use `mod_rewrite` or something similar to42 rewrite the URL) or let the server point to the file directly.43 44 In Apache for example you can put a like like this into the config:45 5 unmodified linesmodified:docs/deploying/fastcgi.rst+1 added-1 removed
121 unmodified lines122 $ su www-data123 $ cd /var/www/yourapplication124 $ python application.fcgi125 Traceback (most recent call last):126- File "yourapplication.fcg", line 4, in <module>126+ File "yourapplication.fcgi", line 4, in <module>127 ImportError: No module named yourapplication128 129 In this case the error seems to be "yourapplication" not being on the python130 path. Common problems are:9 unmodified linesmodified:docs/deploying/mod_wsgi.rst+2 added-2 removed
91 unmodified lines92 .. _installation instructions: http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide93 .. _virtual python: http://pypi.python.org/pypi/virtualenv94 .. _mod_wsgi wiki: http://code.google.com/p/modwsgi/wiki/95 96-Toubleshooting97---------------96+Troubleshooting97+---------------98 99 If your application does not run, follow this guide to troubleshoot:100 101 **Problem:** application does not run, errorlog shows SystemExit ignored65 unmodified linesmodified:docs/deploying/others.rst+2 added-2 removed
67 unmodified lines68 If you deploy your application behind an HTTP proxy you will need to69 rewrite a few headers in order for the application to work. The two70 problematic values in the WSGI environment usually are `REMOTE_ADDR` and71 `HTTP_HOST`. Werkzeug ships a fixer that will solve some common setups,72-but you might want to write your own WSGI middlware for specific setups.72+but you might want to write your own WSGI middleware for specific setups.73 74 The most common setup invokes the host being set from `X-Forwarded-Host`75-and the remote address from `X-Forwared-For`::75+and the remote address from `X-Forward-For`::76 77 from werkzeug.contrib.fixers import ProxyFix78 app.wsgi_app = ProxyFix(app.wsgi_app)79 19 unmodified linesmodified:docs/patterns/errorpages.rst+1 added-1 removed
31 unmodified lines32 resources that previously existed and got deleted answer with 41033 instead of 404. If you are not deleting documents permanently from34 the database but just mark them as deleted, do the user a favour and35 use the 410 code instead and display a message that what he was36- looking for was deleted for all ethernity.36+ looking for was deleted for all eternity.37 38 *500 Internal Server Error*39 Usually happens on programming errors or if the server is overloaded.40 A terrible good idea to have a nice page there, because your37 unmodified linesmodified:docs/patterns/fileuploads.rst+3 added-3 removed
39 unmodified lines40 41 Why do we limit the extensions that are allowed? You probably don't want42 your users to be able to upload everything there if the server is directly43 sending out the data to the client. That way you can make sure that users44-are not able to upload HTML files that would cause XSS problems. Also45-make sure to disallow `.php` files if the server executes them, but who46-has PHP installed on his server, right? :)44+are not able to upload HTML files that would cause XSS problems (see45+:ref:`xss`). Also make sure to disallow `.php` files if the server46+executes them, but who has PHP installed on his server, right? :)47 48 Next the functions that check if an extension is valid and that uploads49 the file and redirects the user to the URL for the uploaded file::50 130 unmodified linesmodified:docs/patterns/flashing.rst+2 added-2 removed
28 unmodified lines29 if request.form['username'] != 'admin' or \30 request.form['password'] != 'secret':31 error = 'Invalid credentials'32 else:33- flash('You were sucessfully logged in')33+ flash('You were successfully logged in')34 return redirect(url_for('index'))35 return render_template('login.html', error=error)36 37 And here the ``layout.html`` template which does the magic:61 unmodified lines99 flash(u'Invalid password provided', 'error')100 101 Inside the template you then have to tell the102 :func:`~flask.get_flashed_messages` function to also return the103-categories. The loop looks slighty different in that situation then:103+categories. The loop looks slightly different in that situation then:104 105 .. sourcecode:: html+jinja106 107 {% with messages = get_flashed_messages(with_categories=true) %}12 unmodified linesmodified:docs/patterns/lazyloading.rst+1 added-1 removed
98 unmodified lines99 url('/', 'views.index')100 url('/user/<username>', 'views.user')101 102 One thing to keep in mind is that before and after request handlers have103-to be in a file that is imported upfront to work propery on the first103+to be in a file that is imported upfront to work properly on the first104 request. The same goes for any kind of remaining decorator.modified:docs/patterns/mongokit.rst+1 added-1 removed
76 unmodified lines77 validator for the maximum character length and uses a special MongoKit feature78 called `use_dot_notation`. Per default MongoKit behaves like a python79 dictionary but with `use_dot_notation` set to `True` you can use your80 documents like you use models in nearly any other ORM by using dots to81-seperate between attributes.81+separate between attributes.82 83 You can insert entries into the database like this:84 85 >>> from yourapplication.database import connection59 unmodified linesmodified:docs/patterns/sqlite3.rst+1 added-1 removed
59 unmodified lines60 print the_username, 'has the id', user['user_id']61 62 To pass variable parts to the SQL statement, use a question mark in the63 statement and pass in the arguments as a list. Never directly add them to64-the SQL statement with string formattings because this makes it possible64+the SQL statement with string formatting because this makes it possible65 to attack the application using `SQL Injections66 <http://en.wikipedia.org/wiki/SQL_injection>`_.67 68 Initial Schemas19 unmodified linesmodified:docs/patterns/viewdecorators.rst+1 added-1 removed
87 unmodified lines88 return rv89 return decorated_function90 return decorator91 92-Notice that this assumes an instanciated `cache` object is available, see92+Notice that this assumes an instantiated `cache` object is available, see93 :ref:`caching-pattern` for more information.94 95 96 Templating Decorator51 unmodified linesmodified:docs/tutorial/setup.rst+1 added-1 removed
74 unmodified lines75 focus on that a little later. First we should get the database working.76 77 .. admonition:: Externally Visible Server78 79- Want your server to be publically available? Check out the79+ Want your server to be publicly available? Check out the80 :ref:`externally visible server <public-server>` section for more81 information.82 83 Continue with :ref:`tutorial-dbinit`.modified:docs/becomingbig.rst+1 added-1 removed
8 unmodified lines9 10 Flask is powered by Werkzeug and Jinja2, two libraries that are in use at11 a number of large websites out there and all Flask does is bring those12 two together. Being a microframework Flask does not do much more than13-combinding existing libraries - there is not a lot of code involved.13+combining existing libraries - there is not a lot of code involved.14 What that means for large applications is that it's very easy to take the15 code from Flask and put it into a new module within the applications and16 expand on that.17 71 unmodified linesmodified:docs/config.rst+2 added-2 removed
59 unmodified lines60 :class:`datetime.timedelta` object.61 ``USE_X_SENDFILE`` enable/disable x-sendfile62 ``LOGGER_NAME`` the name of the logger63 ``SERVER_NAME`` the name of the server. Required for64- subdomain support (eg: ``'localhost'``)64+ subdomain support (e.g.: ``'localhost'``)65 ``MAX_CONTENT_LENGTH`` If set to a value in bytes, Flask will66 reject incoming requests with a67 content length greater than this by68 returning a 413 status code.152 unmodified lines221 code at all. If you are working often on different projects you can222 even create your own script for sourcing that activates a virtualenv223 and exports the development configuration for you.224 - Use a tool like `fabric`_ in production to push code and225- configurations sepearately to the production server(s). For some225+ configurations separately to the production server(s). For some226 details about how to do that, head over to the :ref:`deploy` pattern.227 228 .. _fabric: http://fabfile.org/modified:docs/extensiondev.rst+1 added-1 removed
151 unmodified lines152 There are two recommended ways for an extension to initialize:153 154 initialization functions:155 If your extension is called `helloworld` you might have a function156- called ``init_helloworld(app[, extra_args])`` that initalizes the156+ called ``init_helloworld(app[, extra_args])`` that initializes the157 extension for that application. It could attach before / after158 handlers etc.159 160 classes:167 unmodified linesmodified:docs/license.rst+1 added-1 removed
2 unmodified lines3 4 Flask is licensed under a three clause BSD License. It basically means:5 do whatever you want with it as long as the copyright in Flask sticks6 around, the conditions are not modified and the disclaimer is present.7-Furthermore you must not use the names of the authors to promote derivates7+Furthermore you must not use the names of the authors to promote derivatives8 of the software without written consent.9 10 The full license text can be found below (:ref:`flask-license`). For the11 documentation and artwork different licenses apply.37 unmodified linesmodified:docs/styleguide.rst+3 added-3 removed
70 unmodified lines71 --------------------------72 73 General whitespace rules:74 - No whitespace for unary operators that are not words75- (eg: ``-``, ``~`` etc.) as well on the inner side of parentheses.75+ (e.g.: ``-``, ``~`` etc.) as well on the inner side of parentheses.76 - Whitespace is placed between binary operators.77 78 Good::79 70 unmodified lines150 151 Docstring conventions:152 All docstrings are formatted with reStructuredText as understood by153 Sphinx. Depending on the number of lines in the docstring, they are154- layed out differently. If it's just one line, the closing triple154+ laid out differently. If it's just one line, the closing triple155 quote is on the same line as the opening, otherwise the text is on156 the same line as the opening quote and the triple quote that closes157 the string on its own line::158 2 unmodified lines161 162 163 def bar():164 """This is a longer docstring with so much information in there165- that it spans three lines. In this case the closing tripple quote165+ that it spans three lines. In this case the closing triple quote166 is on its own line.167 """168 169 Module header:31 unmodified linesmodified:docs/templating.rst+1 added-1 removed
142 unmodified lines143 <p>autoescaping is disabled here144 <p>{{ will_not_be_escaped }}145 {% endautoescape %}146 147-Whenever you do this, please be very cautious about the varibles you are147+Whenever you do this, please be very cautious about the variables you are148 using in this block.149 150 Registering Filters151 -------------------37 unmodified linesmodified:docs/upgrading.rst+1 added-1 removed
50 unmodified lines51 order of after-request handlers. Previously they were called in the order52 of the registration, now they are called in reverse order. This change53 was made so that Flask behaves more like people expected it to work and54 how other systems handle request pre- and postprocessing. If you55-dependend on the order of execution of post-request functions, be sure to55+depend on the order of execution of post-request functions, be sure to56 change the order.57 58 Another change that breaks backwards compatibility is that context59 processors will no longer override values passed directly to the template78 unmodified lines