Skip to content

Commit 0d648fa

Browse files
Reetta VaahtorantaReetta Vaahtoranta
authored andcommitted
Changed the wording of some sentences there were difficult to understand.
1 parent d4f8634 commit 0d648fa

File tree

4 files changed

+13
-20
lines changed

4 files changed

+13
-20
lines changed

docs/tutorial/dbinit.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Step 4: Creating The Database
44
=============================
55

6-
Flaskr is a database powered application as outlined earlier, and more
7-
precisely, an application powered by a relational database system. Such
6+
As outlined earlier, Flaskr is a database powered application, and more
7+
precisely, it is an application powered by a relational database system. Such
88
systems need a schema that tells them how to store that information. So
99
before starting the server for the first time it's important to create
1010
that schema.
@@ -15,13 +15,11 @@ Such a schema can be created by piping the `schema.sql` file into the
1515
sqlite3 /tmp/flaskr.db < schema.sql
1616

1717
The downside of this is that it requires the sqlite3 command to be
18-
installed which is not necessarily the case on every system. Also one has
19-
to provide the path to the database there which leaves some place for
20-
errors. It's a good idea to add a function that initializes the database
18+
installed which is not necessarily the case on every system. This also require that we provide the path to the database which can introduce errors. It's a good idea to add a function that initializes the database
2119
for you to the application.
2220

2321
To do this we can create a function called `init_db` that initializes the
24-
database. Let me show you the code first. Just add that function below
22+
database. Let me show you the code first. Just add this function below
2523
the `connect_db` function in `flaskr.py`::
2624

2725
def init_db():

docs/tutorial/folders.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ application::
1111
/templates
1212

1313
The `flaskr` folder is not a python package, but just something where we
14-
drop our files. Directly into this folder we will then put our database
15-
schema as well as main module in the following steps. The files inside
14+
drop our files. We will then put our database schema as well as main module
15+
into this folder. It is done in the following way. The files inside
1616
the `static` folder are available to users of the application via `HTTP`.
1717
This is the place where css and javascript files go. Inside the
1818
`templates` folder Flask will look for `Jinja2`_ templates. The

docs/tutorial/schema.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
Step 1: Database Schema
44
=======================
55

6-
First we want to create the database schema. For this application only a
7-
single table is needed and we only want to support SQLite so that is quite
8-
easy. Just put the following contents into a file named `schema.sql` in
9-
the just created `flaskr` folder:
6+
First we want to create the database schema. Only a single table is needed
7+
for this application and we only want to support SQLite so creating the database schema is quite easy. Just put the following contents into a file named `schema.sql` in the just created `flaskr` folder:
108

119
.. sourcecode:: sql
1210

docs/tutorial/setup.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ Step 2: Application Setup Code
44
==============================
55

66
Now that we have the schema in place we can create the application module.
7-
Let's call it `flaskr.py` inside the `flaskr` folder. For starters we
8-
will add the imports and create the application object. For small
9-
applications it's a possibility to drop the configuration directly into
10-
the module which we will be doing here. However a cleaner solution would
11-
be to create a separate `.ini` or `.py` file and load that or import the
7+
Let's call it flaskr.py. We will place this file inside the flask folder.
8+
We will begin by adding the imports we need and by adding the config section.
9+
For small applications, it is possible to drop the configuration directly into
10+
the module, and this is what we will be doing here. However a cleaner solution would be to create a separate `.ini` or `.py` file and load that or import the
1211
values from there.
1312

1413
First we add the imports in `flaskr.py`::
@@ -66,9 +65,7 @@ debug flag enables or disables the interactive debugger. *Never leave
6665
debug mode activated in a production system*, because it will allow users to
6766
execute code on the server!
6867

69-
We also add a method to easily connect to the database specified. That
70-
can be used to open a connection on request and also from the interactive
71-
Python shell or a script. This will come in handy later. We create a
68+
We will also add a method that allows for easily connecting to the specified database. This can be used to open a connection on request and also from the interactive Python shell or a script. This will come in handy later. We create a
7269
simple database connection through SQLite and then tell it to use the
7370
:class:`sqlite3.Row` object to represent rows. This allows us to treat
7471
the rows as if they were dictionaries instead of tuples.

0 commit comments

Comments
 (0)