Skip to content

Commit 537f179

Browse files
Minor adjustments to paragraphing in customization doc
1 parent 2259f11 commit 537f179

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/customization.qmd

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The project uses type annotations and mypy for static type checking. To run mypy
4343
mypy
4444
```
4545

46-
We find that mypy is an enormous time-saver, catching many errors early and greatly reducing time spent debugging unit tests. However, note that mypy requires you type annotate every variable, function, and method in your code base, so taking advantage of it is a lifestyle change!
46+
We find that mypy is an enormous time-saver, catching many errors early and greatly reducing time spent debugging unit tests. However, note that mypy requires you type annotate every variable, function, and method in your code base, so taking advantage of it requires a lifestyle change!
4747

4848
## Project structure
4949

@@ -80,15 +80,19 @@ We also create POST endpoints, which accept form submissions so the user can cre
8080

8181
#### Routing patterns in this template
8282

83-
In this template, GET routes are defined in the main entry point for the application, `main.py`. POST routes are organized into separate modules within the `routers/` directory. We name our GET routes using the convention `read_<name>`, where `<name>` is the name of the page, to indicate that they are read-only endpoints that do not modify the database.
83+
In this template, GET routes are defined in the main entry point for the application, `main.py`. POST routes are organized into separate modules within the `routers/` directory.
84+
85+
We name our GET routes using the convention `read_<name>`, where `<name>` is the name of the page, to indicate that they are read-only endpoints that do not modify the database.
8486

8587
We divide our GET routes into authenticated and unauthenticated routes, using commented section headers in our code that look like this:
8688

8789
```python
8890
# -- Authenticated Routes --
8991
```
9092

91-
Some of our routes take request parameters, which we pass as keyword arguments to the route handler. These parameters should be type annotated for validation purposes. Some parameters are shared across all authenticated or unauthenticated routes, so we define them in the `common_authenticated_parameters` and `common_unauthenticated_parameters` dependencies defined in `main.py`.
93+
Some of our routes take request parameters, which we pass as keyword arguments to the route handler. These parameters should be type annotated for validation purposes.
94+
95+
Some parameters are shared across all authenticated or unauthenticated routes, so we define them in the `common_authenticated_parameters` and `common_unauthenticated_parameters` dependencies defined in `main.py`.
9296

9397
### HTML templating with Jinja2
9498

@@ -109,7 +113,7 @@ async def welcome(request: Request):
109113
)
110114
```
111115

112-
In this example, the `welcome.html` template will receive two pieces of context: the user's `request`, which is always passed automatically by FastAPI, and a `username` variable, which we specify as "Alice". We can then use the `{{ username }}` syntax in the `welcome.html` template (or any of its parent or child templates) to insert the value into the HTML.
116+
In this example, the `welcome.html` template will receive two pieces of context: the user's `request`, which is always passed automatically by FastAPI, and a `username` variable, which we specify as "Alice". We can then use the `{{{ username }}}` syntax in the `welcome.html` template (or any of its parent or child templates) to insert the value into the HTML.
113117

114118
#### Form validation strategy
115119

0 commit comments

Comments
 (0)