📝 More info on shell command
This commit is contained in:
parent
aea68b8128
commit
ce6b57bf9d
1 changed files with 37 additions and 8 deletions
45
README.md
45
README.md
|
|
@ -183,14 +183,6 @@ Run your project:
|
||||||
ohmyapi serve
|
ohmyapi serve
|
||||||
```
|
```
|
||||||
|
|
||||||
## Shell
|
|
||||||
|
|
||||||
Similar to Django, you can attach to an interactive shell with your project already loaded inside.
|
|
||||||
|
|
||||||
```
|
|
||||||
ohmyapi shell
|
|
||||||
```
|
|
||||||
|
|
||||||
## Authentication
|
## Authentication
|
||||||
|
|
||||||
A builtin auth app is available.
|
A builtin auth app is available.
|
||||||
|
|
@ -281,3 +273,40 @@ class Team(Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
manager = TeamManager()
|
manager = TeamManager()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Shell
|
||||||
|
|
||||||
|
Similar to Django, you can attach to an interactive shell with your project already loaded inside.
|
||||||
|
|
||||||
|
```
|
||||||
|
ohmyapi shell
|
||||||
|
|
||||||
|
Python 3.13.7 (main, Aug 15 2025, 12:34:02) [GCC 15.2.1 20250813]
|
||||||
|
Type 'copyright', 'credits' or 'license' for more information
|
||||||
|
IPython 9.5.0 -- An enhanced Interactive Python. Type '?' for help.
|
||||||
|
|
||||||
|
OhMyAPI Shell | Project: {{ project_name }} [{{ project_path }}]
|
||||||
|
Find your loaded project singleton via identifier: `p`
|
||||||
|
```
|
||||||
|
|
||||||
|
```python
|
||||||
|
In [1]: p
|
||||||
|
Out[1]: <ohmyapi.core.runtime.Project at 0xdeadbeefc0febabe>
|
||||||
|
|
||||||
|
In [2]: p.apps
|
||||||
|
Out[2]:
|
||||||
|
{'ohmyapi_auth': App: ohmyapi_auth
|
||||||
|
Models:
|
||||||
|
- Group
|
||||||
|
- User
|
||||||
|
Routes:
|
||||||
|
- APIRoute(path='/auth/login', name='login', methods=['POST'])
|
||||||
|
- APIRoute(path='/auth/refresh', name='refresh_token', methods=['POST'])
|
||||||
|
- APIRoute(path='/auth/me', name='me', methods=['GET'])
|
||||||
|
- APIRoute(path='/auth/introspect', name='introspect', methods=['GET'])}
|
||||||
|
|
||||||
|
In [3]: from tournament.models import Tournament
|
||||||
|
Out[3]:
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue