In line 802 we import the function run from uvicorn.
in line 813 the function is called uvicorn.run() but it should be run()
from uvicorn import run
bk = inspect.currentframe().f_back
glb = bk.f_globals
code = bk.f_code
if not appname:
if glb.get('name')=='main': appname = Path(glb.get('file', '')).stem
elif code.co_name=='main' and bk.f_back.f_globals.get('name')=='main': appname = inspect.getmodule(bk).name
if appname:
if not port: port=int(os.getenv("PORT", default=5001))
link = f'http://{"localhost" if host=="0.0.0.0" else host}:{port}'
print('Link: '+ S.light_red.bold(link))
uvicorn.run(f'{appname}:{app}', host=host, port=port, reload=reload, **kwargs)
In line 802 we import the function run from uvicorn.
in line 813 the function is called uvicorn.run() but it should be run()
from uvicorn import run
bk = inspect.currentframe().f_back
glb = bk.f_globals
code = bk.f_code
if not appname:
if glb.get('name')=='main': appname = Path(glb.get('file', '')).stem
elif code.co_name=='main' and bk.f_back.f_globals.get('name')=='main': appname = inspect.getmodule(bk).name
if appname:
if not port: port=int(os.getenv("PORT", default=5001))
link = f'http://{"localhost" if host=="0.0.0.0" else host}:{port}'
print('Link: '+ S.light_red.bold(link))
uvicorn.run(f'{appname}:{app}', host=host, port=port, reload=reload, **kwargs)