📝 Add mkdocs
This commit is contained in:
parent
a3d9862c4e
commit
91baf968d7
10 changed files with 498 additions and 380 deletions
34
docs/apps.md
Normal file
34
docs/apps.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Apps
|
||||
|
||||
Apps are a way to group database models and API routes that contextually belong together.
|
||||
For example, OhMyAPI comes bundled with an `auth` app that carries a `User` and `Group` model and provides API endpoints for JWT authentication.
|
||||
|
||||
Apps help organizing projects by isolating individual components (or "features") from one another.
|
||||
|
||||
## Create an App
|
||||
|
||||
Create a new app by: `ohmyapi startapp <name>`, i.e.:
|
||||
|
||||
```
|
||||
ohmyapi startapp restaurant
|
||||
```
|
||||
|
||||
This will create the following directory structure:
|
||||
|
||||
```
|
||||
myproject/
|
||||
- restaurant/
|
||||
- __init__.py
|
||||
- models.py
|
||||
- routes.py
|
||||
- pyproject.toml
|
||||
- README.md
|
||||
- settings.py
|
||||
```
|
||||
|
||||
Add `restaurant` to your `INSTALLED_APPS` in `settings.py` and restart you project runtime:
|
||||
|
||||
```
|
||||
ohmyapi serve
|
||||
```
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue