Skip to content

Commit d84dab5

Browse files
committed
Doc: Fix grammar and formatting issues
1 parent dae64a0 commit d84dab5

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

load_multiple_users.md

+20-21
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Flask provides us with the `flask-wtf` package that allows for the creation of w
2727

2828
### Create a Registration Form
2929

30-
Following the principle of _separation of concerns_, we will create a `forms` module with will hold all the forms our application will need. Inside `app/` subfolder, create an empty form called `forms.py`.
30+
Following the principle of _separation of concerns_, we will create a `forms` module which will hold all the forms our application will need. Inside `app/` subfolder, create an empty form called `forms.py`.
3131

3232
```python
33-
(venv) $ mkdir app/forms.py
33+
(venv) $ touch app/forms.py
3434
```
3535

3636
We will begin by creating a registration form. This form will collect the same information from both students and teachers.
@@ -51,7 +51,7 @@ class RegisterForm(FlaskForm):
5151
submit = SubmitField('Register')
5252
```
5353

54-
`Flask-wtf` provides several fields and validators that we have used to create the registration form. The first is the `StringField` which is used to collect a string of characters. The second is the `PasswordField` which is used to collect a string of characters. The third is the `EqualTo` validator which is used to compare the value of the password field to the value of the confirm password field. `DataRequired` ensures that the field needs to be field, otherwise clicking the submit button won't work. The last field is the `SubmitField` which is used to submit the form.
54+
`Flask-wtf` provides several fields and validators that we have used to create the registration form. The first is the `StringField` which is used to collect a string of characters. Same to the `PasswordField` . The `SubmitField` is used to submit the form. The `EqualTo` validator is used to compare the value of the password field to the value of the confirm password field. `DataRequired` ensures that the field needs to be field, otherwise clicking the submit button won't work.
5555

5656
### Display the Registration Form
5757

@@ -73,7 +73,7 @@ Within the `app/templates`, we will create a `register.html` file. This file wil
7373
{% endblock %}
7474
```
7575

76-
In a single line of code, we are able to display the registration form. We are using the `wtf.quick_form` macro to create the form. The `wtf.quick_form` function takes in a form as an argument. We will use the `form` variable to store the form. The good thing here is that our form has all the styles needed to look good, thanks to the Bootstrap framework.
76+
In a single line of code, we are able to display the registration form. We have used the `wtf.quick_form` macro to create the form. The `wtf.quick_form` function takes in a form as an argument. We will use the `form` variable to store the form. The good thing here is that our form has all the styles needed to look good, thanks to the Bootstrap framework.
7777

7878
### Render the Registration Form
7979

@@ -134,22 +134,7 @@ class Config(object):
134134
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
135135

136136
```
137-
We are sourcing the value of the `SECRET_KEY` from an environment variable. If the variable is not set, we will use the string `you-will-never-guess`.
138-
139-
The next step will be to register this configuration module within the application instance.
140-
141-
`__init__.py: Register the Configuration Module`
142-
```python
143-
# ...
144-
from config import Config
145-
146-
# ...
147-
app.config.from_object(Config)
148-
149-
# ...
150-
```
151-
152-
To add this enviroment variable, we will do so in the `.env` file. Create this file in the top-level directory of our application.
137+
We are sourcing the value of the `SECRET_KEY` from an environment variable. If the variable is not set, we will use the string `you-will-never-guess`. To add this enviroment variable, we will do so in the `.env` file. Create this file in the top-level directory of our application.
153138

154139
```python
155140
(venv) $ touch .env
@@ -167,7 +152,21 @@ As the name suggests, this value should be secret, and hard to guess. I was able
167152
(venv) $ python3 -c "import os; print(os.urandom(16))"
168153
```
169154

170-
Now, reloading the application will display the registration form.
155+
The next step will be to register this configuration module within the application instance.
156+
157+
`__init__.py: Register the Configuration Module`
158+
```python
159+
# ...
160+
from config import Config
161+
162+
# ...
163+
app.config.from_object(Config)
164+
165+
# ...
166+
```
167+
168+
169+
Now, reloading the application in your browser will display the registration form.
171170

172171
![Student Registration Form](images/load_multiple_users/register_student.png)
173172

0 commit comments

Comments
 (0)