feat: add option to configure database connection via DATABASE_URL
This commit is contained in:
6 files changed
+61
-21
No files matched your search
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user