fix(djinit/utils): inject project_name into manage.py template rendering
Bug Fixes - Add `project_name` to the template context when creating `manage.py` to prevent missing‑variable errors.
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -104,8 +104,8 @@ class FileManager:
|
|||||||
|
|
||||||
files = [
|
files = [
|
||||||
("urls.py", "config/urls/with_api.j2", urls_context),
|
("urls.py", "config/urls/with_api.j2", urls_context),
|
||||||
("wsgi.py", "config/wsgi.j2", {}),
|
("wsgi.py", "config/wsgi.j2", {"project_name": prefix}),
|
||||||
("asgi.py", "config/asgi.j2", {}),
|
("asgi.py", "config/asgi.j2", {"project_name": prefix}),
|
||||||
]
|
]
|
||||||
|
|
||||||
for filename, template, context in files:
|
for filename, template, context in files:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class DjangoHelper:
|
|||||||
os.makedirs(directory, exist_ok=True)
|
os.makedirs(directory, exist_ok=True)
|
||||||
|
|
||||||
manage_py_path = os.path.join(directory, "manage.py")
|
manage_py_path = os.path.join(directory, "manage.py")
|
||||||
create_file_from_template(manage_py_path, "project/manage_py.j2", {}, "Created manage.py")
|
create_file_from_template(manage_py_path, "project/manage_py.j2", {"project_name": project_name}, "Created manage.py")
|
||||||
os.chmod(manage_py_path, 0o755)
|
os.chmod(manage_py_path, 0o755)
|
||||||
|
|
||||||
if unified:
|
if unified:
|
||||||
|
|||||||
Reference in new issue
Block a user