Relative Content

Tag Archive for pythonfastapipyinstaller

app.mout not working while packaging fastapi application using pyinstaller

app = FastAPI() base_dir = os.path.dirname(os.path.abspath(file)) static_dir = os.path.join(base_dir, “app/static”) templates_dir = os.path.join(base_dir, “app/templates”) app.mount(“/static”, StaticFiles(directory=static_dir), name=”static”) app.mount(“/templates”, StaticFiles(directory=templates_dir), name=”templates”) app.include_router(auths.auth) if name == “main”: import uvicorn uvicorn.run(app, host=”0.0.0.0″, port=8000) Application is running well through uvicorn or python main.py or fastapi dev but i am trying to make build of my application through pyinstaller (command […]