feat: add option to configure database connection via DATABASE_URL

This commit is contained in:
sankalp committed 2025-10-29 10:48:52 +05:45
1 parent e028094193
commit 1a2e50900d
6 files changed
+61 -21

No files matched your search

+6 -2
View File
@@ -30,7 +30,8 @@ class FileManager:
def create_requirements(self) -> bool:
with change_cwd(self.project_root):
requirements_content = template_engine.render_template("requirements.j2", {})
context = {"use_database_url": self.metadata.get("use_database_url", True)}
requirements_content = template_engine.render_template("requirements.j2", context)
return create_file_with_content(
"requirements.txt",
requirements_content,
@@ -50,7 +51,10 @@ class FileManager:
def create_env_file(self) -> bool:
"""Create .env.sample file with environment variables."""
with change_cwd(self.project_root):
context = {"project_name": self.project_name}
context = {
"project_name": self.project_name,
"use_database_url": self.metadata.get("use_database_url", True)
}
env_content = template_engine.render_template("env_sample.j2", context)
return create_file_with_content(
".env.sample",