Fix hardcoded project dir in template __main__.py (regression in commit 1b24a7).

This commit is contained in:
2026-06-29 18:18:04 +00:00
parent 15a6710c17
commit ec6a084969
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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,