📝 Add more info on migrations
This commit is contained in:
parent
898ab6de99
commit
8d9264e8db
1 changed files with 16 additions and 1 deletions
17
README.md
17
README.md
|
|
@ -116,7 +116,21 @@ Similar to Django, first run:
|
||||||
ohmyapi makemigrations [ <app> ] # no app means all INSTALLED_APPS
|
ohmyapi makemigrations [ <app> ] # no app means all INSTALLED_APPS
|
||||||
```
|
```
|
||||||
|
|
||||||
And the apply your migrations via:
|
This will create a `migrations/` folder in you project root.
|
||||||
|
|
||||||
|
```
|
||||||
|
myproject/
|
||||||
|
- myapp/
|
||||||
|
- __init__.py
|
||||||
|
- models.py
|
||||||
|
- routes.py
|
||||||
|
- migrations/
|
||||||
|
- myapp/
|
||||||
|
- pyproject.toml
|
||||||
|
- settings.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Apply your migrations via:
|
||||||
|
|
||||||
```
|
```
|
||||||
ohmyapi migrate [ <app> ] # no app means all INSTALLED_APPS
|
ohmyapi migrate [ <app> ] # no app means all INSTALLED_APPS
|
||||||
|
|
@ -139,6 +153,7 @@ ohmyapi shell
|
||||||
## Authentication
|
## Authentication
|
||||||
|
|
||||||
A builtin auth app is available.
|
A builtin auth app is available.
|
||||||
|
|
||||||
Simply add `ohmyapi_auth` to your INSTALLED_APPS and define a JWT_SECRET in your `settings.py`.
|
Simply add `ohmyapi_auth` to your INSTALLED_APPS and define a JWT_SECRET in your `settings.py`.
|
||||||
Remember to `makemigrations` and `migrate` for the auth tables to be created in the database.
|
Remember to `makemigrations` and `migrate` for the auth tables to be created in the database.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue