Skip to content

Commit afd3c45

Browse files
committed
Rewrapped lines
1 parent 0d648fa commit afd3c45

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

docs/tutorial/dbinit.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ 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. 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
18+
installed which is not necessarily the case on every system. This also
19+
require that we provide the path to the database which can introduce
20+
errors. It's a good idea to add a function that initializes the database
1921
for you to the application.
2022

2123
To do this we can create a function called `init_db` that initializes the

docs/tutorial/schema.rst

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

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:
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
8+
database schema is quite easy. Just put the following contents into a file
9+
named `schema.sql` in the just created `flaskr` folder:
810

911
.. sourcecode:: sql
1012

docs/tutorial/setup.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ 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. 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
11-
values from there.
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
9+
section. For small applications, it is possible to drop the configuration
10+
directly into the module, and this is what we will be doing here. However
11+
a cleaner solution would be to create a separate `.ini` or `.py` file and
12+
load that or import the values from there.
1213

1314
First we add the imports in `flaskr.py`::
1415

@@ -65,10 +66,13 @@ debug flag enables or disables the interactive debugger. *Never leave
6566
debug mode activated in a production system*, because it will allow users to
6667
execute code on the server!
6768

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
69-
simple database connection through SQLite and then tell it to use the
70-
:class:`sqlite3.Row` object to represent rows. This allows us to treat
71-
the rows as if they were dictionaries instead of tuples.
69+
We will also add a method that allows for easily connecting to the
70+
specified database. This can be used to open a connection on request and
71+
also from the interactive Python shell or a script. This will come in
72+
handy later. We create a simple database connection through SQLite and
73+
then tell it to use the :class:`sqlite3.Row` object to represent rows.
74+
This allows us to treat the rows as if they were dictionaries instead of
75+
tuples.
7276

7377
::
7478

0 commit comments

Comments
 (0)