Fixed small typos in docs. Added a cross-ref.
This commit is contained in:
parent
216478f715
commit
6875a057ec
19 changed files with 27 additions and 27 deletions
|
|
@ -33,7 +33,7 @@ even if the application behaves correctly:
|
|||
instead of 404. If you are not deleting documents permanently from
|
||||
the database but just mark them as deleted, do the user a favour and
|
||||
use the 410 code instead and display a message that what he was
|
||||
looking for was deleted for all ethernity.
|
||||
looking for was deleted for all eternity.
|
||||
|
||||
*500 Internal Server Error*
|
||||
Usually happens on programming errors or if the server is overloaded.
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ the URL to these files.
|
|||
Why do we limit the extensions that are allowed? You probably don't want
|
||||
your users to be able to upload everything there if the server is directly
|
||||
sending out the data to the client. That way you can make sure that users
|
||||
are not able to upload HTML files that would cause XSS problems. Also
|
||||
make sure to disallow `.php` files if the server executes them, but who
|
||||
has PHP installed on his server, right? :)
|
||||
are not able to upload HTML files that would cause XSS problems (see
|
||||
:ref:`xss`). Also make sure to disallow `.php` files if the server
|
||||
executes them, but who has PHP installed on his server, right? :)
|
||||
|
||||
Next the functions that check if an extension is valid and that uploads
|
||||
the file and redirects the user to the URL for the uploaded file::
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ So here is a full example::
|
|||
request.form['password'] != 'secret':
|
||||
error = 'Invalid credentials'
|
||||
else:
|
||||
flash('You were sucessfully logged in')
|
||||
flash('You were successfully logged in')
|
||||
return redirect(url_for('index'))
|
||||
return render_template('login.html', error=error)
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ to the :func:`~flask.flash` function::
|
|||
|
||||
Inside the template you then have to tell the
|
||||
:func:`~flask.get_flashed_messages` function to also return the
|
||||
categories. The loop looks slighty different in that situation then:
|
||||
categories. The loop looks slightly different in that situation then:
|
||||
|
||||
.. sourcecode:: html+jinja
|
||||
|
||||
|
|
|
|||
|
|
@ -100,5 +100,5 @@ name and a dot, and by wrapping `view_func` in a `LazyView` as needed::
|
|||
url('/user/<username>', 'views.user')
|
||||
|
||||
One thing to keep in mind is that before and after request handlers have
|
||||
to be in a file that is imported upfront to work propery on the first
|
||||
to be in a file that is imported upfront to work properly on the first
|
||||
request. The same goes for any kind of remaining decorator.
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ validator for the maximum character length and uses a special MongoKit feature
|
|||
called `use_dot_notation`. Per default MongoKit behaves like a python
|
||||
dictionary but with `use_dot_notation` set to `True` you can use your
|
||||
documents like you use models in nearly any other ORM by using dots to
|
||||
seperate between attributes.
|
||||
separate between attributes.
|
||||
|
||||
You can insert entries into the database like this:
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ Or if you just want a single result::
|
|||
|
||||
To pass variable parts to the SQL statement, use a question mark in the
|
||||
statement and pass in the arguments as a list. Never directly add them to
|
||||
the SQL statement with string formattings because this makes it possible
|
||||
the SQL statement with string formatting because this makes it possible
|
||||
to attack the application using `SQL Injections
|
||||
<http://en.wikipedia.org/wiki/SQL_injection>`_.
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ Here the code::
|
|||
return decorated_function
|
||||
return decorator
|
||||
|
||||
Notice that this assumes an instanciated `cache` object is available, see
|
||||
Notice that this assumes an instantiated `cache` object is available, see
|
||||
:ref:`caching-pattern` for more information.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue