♻️Refactor App/Project

- also fix ohmyapi.core.scaffolding.startapp
This commit is contained in:
Brian Wiborg 2025-09-27 06:04:19 +02:00
parent 69bd447374
commit 557bda6045
No known key found for this signature in database
2 changed files with 63 additions and 62 deletions

View file

@ -55,7 +55,7 @@ def startapp(name: str, project: str):
"""Create a new app inside a project: templates go into <project_dir>/<name>/"""
target_dir = Path(project)
os.makedirs(target_dir, exist_ok=True)
render_template_dir("app", target_dir, {"project_name": project, "app_name": name}, subdir_name=name)
render_template_dir("app", target_dir, {"project_name": target_dir.resolve().name, "app_name": name}, subdir_name=name)
print(f"✅ App '{name}' created in project '{target_dir}' successfully.")
print(f"🔧 Remember to add '{name}' to your INSTALLED_APPS!")