-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.py
46 lines (32 loc) · 920 Bytes
/
manage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import logging.config
import typer
import uvicorn
from app.presentation.bootstrap import bootstrap
from app.presentation.cli import shell
from app.settings import LoggingSettings, VERSION
app = typer.Typer()
app.command("shell", help="Run python shell.")(shell.command)
@app.command("runserver")
def run_server():
uvicorn.run(
"app.presentation.api.factory:create_app",
port=8000,
factory=True,
reload=True,
log_config=None,
)
@app.command()
def version():
"""Echo the version."""
typer.echo(f"v{VERSION}")
@app.command("dropdb")
def drop_db():
"""Drop the database."""
typer.echo("Co ty kurwa robisz?")
def startup():
container, mediator = bootstrap()
settings = container.resolve(LoggingSettings)
logging.config.dictConfig(settings.get_logging_config(is_local=settings.debug))
app()
if __name__ == "__main__":
startup()