[cli][conf] suppression of BASE_DIR option (now defaults to os.getcwd)
This commit is contained in:
parent
cb5724b4fa
commit
710d390b49
|
@ -14,7 +14,6 @@ from ..conf import (
|
||||||
HOST,
|
HOST,
|
||||||
PORT,
|
PORT,
|
||||||
PRODUCTION,
|
PRODUCTION,
|
||||||
BASE_DIR
|
|
||||||
)
|
)
|
||||||
|
|
||||||
CONF_STR=f"""
|
CONF_STR=f"""
|
||||||
|
@ -23,7 +22,6 @@ name = {PROJECT_NAME}
|
||||||
host = {HOST}
|
host = {HOST}
|
||||||
port = {PORT}
|
port = {PORT}
|
||||||
production = {PRODUCTION}
|
production = {PRODUCTION}
|
||||||
base_dir = {BASE_DIR}
|
|
||||||
|
|
||||||
[domains]"""
|
[domains]"""
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"""
|
"""
|
||||||
cli/domain.py Defines the "halfapi run" cli command
|
cli/domain.py Defines the "halfapi run" cli command
|
||||||
"""
|
"""
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import click
|
import click
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
@ -9,7 +10,7 @@ import uvicorn
|
||||||
from .cli import cli
|
from .cli import cli
|
||||||
from .domain import list_api_routes
|
from .domain import list_api_routes
|
||||||
from ..conf import (PROJECT_NAME, HOST, PORT,
|
from ..conf import (PROJECT_NAME, HOST, PORT,
|
||||||
PRODUCTION, BASE_DIR, DOMAINSDICT)
|
PRODUCTION, DOMAINSDICT)
|
||||||
|
|
||||||
@click.option('--host', default=None)
|
@click.option('--host', default=None)
|
||||||
@click.option('--port', default=None)
|
@click.option('--port', default=None)
|
||||||
|
@ -32,7 +33,7 @@ def run(host, port):
|
||||||
|
|
||||||
click.echo(f'Launching application {PROJECT_NAME}')
|
click.echo(f'Launching application {PROJECT_NAME}')
|
||||||
|
|
||||||
sys.path.insert(0, BASE_DIR)
|
sys.path.insert(0, os.getcwd())
|
||||||
|
|
||||||
list_api_routes()
|
list_api_routes()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue