Fix hardcoded project dir in template __main__.py (regression in commit 1b24a7).
This commit is contained in:
@@ -1375,7 +1375,7 @@ def cmd_setup(args: argparse.Namespace) -> int:
|
||||
app_file, app_var = app_info
|
||||
print(f"📍 Found FastAPI app: {app_var} in {app_file.name}")
|
||||
tpl_vars["APP_VAR"] = app_var
|
||||
# Dotted module path relative to project dir (e.g. "paskia.fastapi.mainapp")
|
||||
# Dotted module path relative to project dir (e.g. "{module_name}.api.main")
|
||||
app_module = ".".join(app_file.relative_to(project_dir).with_suffix("").parts)
|
||||
tpl_vars["APP_MODULE"] = app_module
|
||||
else:
|
||||
|
||||
@@ -20,7 +20,7 @@ def main() -> None:
|
||||
help=(f"Endpoint (default: localhost:{DEFAULT_PORT})."),
|
||||
)
|
||||
args = parser.parse_args()
|
||||
dev = {"reload": True, "reload_dirs": ["paskia"]} if DEVMODE else {}
|
||||
dev = {"reload": True, "reload_dirs": ["MODULE_NAME"]} if DEVMODE else {}
|
||||
server.run(
|
||||
"APP_MODULE:APP_VAR",
|
||||
listen=args.listen,
|
||||
|
||||
Reference in New Issue
Block a user