forked from orbit-oss/flask
More typo fixes.
This commit is contained in:
parent
63caf6e158
commit
a224fecfd5
9 changed files with 24 additions and 24 deletions
|
|
@ -22,7 +22,7 @@ a package manager or compile it yourself.
|
|||
The mod_wsgi `installation instructions`_ cover source installations on UNIX
|
||||
systems.
|
||||
|
||||
If you are using ubuntu / debian you can apt-get it and activate it as follows:
|
||||
If you are using Ubuntu/Debian you can apt-get it and activate it as follows:
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
|
|
@ -96,7 +96,7 @@ Toubleshooting
|
|||
|
||||
If your application does not run, follow this guide to troubleshoot:
|
||||
|
||||
**Problem:** Application does not run, errorlog shows SystemExit ignored
|
||||
**Problem:** application does not run, errorlog shows SystemExit ignored
|
||||
You have a ``app.run()`` call in your application file that is not
|
||||
guarded by an ``if __name__ == '__main__':`` condition. Either remove
|
||||
that :meth:`~flask.Flask.run` call from the file and move it into a
|
||||
|
|
@ -130,6 +130,6 @@ If your application does not run, follow this guide to troubleshoot:
|
|||
instead you either have to put the folder into the pythonpath the file
|
||||
is stored in, or convert your application into a package.
|
||||
|
||||
The reason for this is that for non-installed Packages, the module
|
||||
The reason for this is that for non-installed packages, the module
|
||||
filename is used to locate the resources and for symlinks the wrong
|
||||
filename is picked up.
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ of variables and take the return value as string.
|
|||
But that's about where similarities end. Jinja2 for example has an
|
||||
extensive filter system, a certain way to do template inheritance, support
|
||||
for reusable blocks (macros) that can be used from inside templates and
|
||||
also from Python code, uses unicode for all operations, supports
|
||||
also from Python code, uses Unicode for all operations, supports
|
||||
iterative template rendering, configurable syntax and more. On the other
|
||||
hand an engine like Genshi is based on XML stream evaluation, template
|
||||
inheritance by taking the availability of XPath into account and more.
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ templates? There are three good reasons for this:
|
|||
1. reversing is often more descriptive than hardcoding the URLs. Also and
|
||||
more importantly you can change URLs in one go without having to change
|
||||
the URLs all over the place.
|
||||
2. URL building will handle escaping of special characters and unicode
|
||||
2. URL building will handle escaping of special characters and Unicode
|
||||
data transparently for you, you don't have to deal with that.
|
||||
3. If your application is placed outside the URL root (so say in
|
||||
``/myapplication`` instead of ``/``), :func:`~flask.url_for` will
|
||||
|
|
@ -663,7 +663,7 @@ not using the template engine (like in this example).
|
|||
|
||||
The problem with random is that it's hard to judge what random is. And
|
||||
a secret key should be as random as possible. Your operating system
|
||||
has ways to generate pretty random stuff based on a cryptographical
|
||||
has ways to generate pretty random stuff based on a cryptographic
|
||||
random generator which can be used to get such a key:
|
||||
|
||||
>>> import os
|
||||
|
|
@ -707,8 +707,8 @@ come in handy. As of Flask 0.3 a logger is preconfigured for you to use.
|
|||
Here are some example log calls::
|
||||
|
||||
app.logger.debug('A value for debugging')
|
||||
app.logger.warning('A warning ocurred (%d apples)', 42)
|
||||
app.logger.error('An error occoured')
|
||||
app.logger.warning('A warning occurred (%d apples)', 42)
|
||||
app.logger.error('An error occurred')
|
||||
|
||||
The attached :attr:`~flask.Flask.logger` is a standard logging
|
||||
:class:`~logging.Logger`, so head over to the official stdlib
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ low-level file handle and a random file name, the latter we use as
|
|||
database name. We just have to keep the `db_fd` around so that we can use
|
||||
the :func:`os.close` function to close the file.
|
||||
|
||||
If we now run that testsuite, we should see the following output::
|
||||
If we now run that test suite, we should see the following output::
|
||||
|
||||
$ python flaskr_tests.py
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.. _tutorial-testing:
|
||||
|
||||
Bonus: Testing the Application
|
||||
===============================
|
||||
==============================
|
||||
|
||||
Now that you have finished the application and everything works as
|
||||
expected, it's probably not a good idea to add automated tests to simplify
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue