mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2026-03-13 07:49:55 +08:00
Rework the documentation
This commit is contained in:
@@ -24,7 +24,7 @@ For the sake of this tutorial from now on, we'll use a simple SQLite databse.
|
||||
|
||||
Let's declare our User ORM model.
|
||||
|
||||
```py hl_lines="29-33"
|
||||
```py hl_lines="11-15"
|
||||
{!./src/db_ormar.py!}
|
||||
```
|
||||
|
||||
@@ -35,19 +35,15 @@ there to fit to your needs!
|
||||
## Create the database adapter
|
||||
|
||||
The database adapter of **FastAPI Users** makes the link between your
|
||||
database configuration and the users logic. Create it like this.
|
||||
database configuration and the users logic. It should be generated by a FastAPI dependency.
|
||||
|
||||
```py hl_lines="40"
|
||||
```py hl_lines="22-23"
|
||||
{!./src/db_ormar.py!}
|
||||
```
|
||||
|
||||
Notice that we pass a reference to your [`UserDB` model](../model.md).
|
||||
Notice that we pass a reference to your [`UserDB` model](../models.md).
|
||||
|
||||
!!! warning
|
||||
In production, it's strongly recommended to setup a migration system to
|
||||
update your SQL schemas. See
|
||||
[Alembic](https://alembic.sqlalchemy.org/en/latest/).
|
||||
|
||||
## Next steps
|
||||
|
||||
We will now configure an [authentication method](../authentication/index.md).
|
||||
|
||||
Reference in New Issue
Block a user