🐛 fix(settings.py): change environment variable name from LANGFLOW_DATABASE_URL to langflow_database_url for consistency
The environment variable name is changed from LANGFLOW_DATABASE_URL to langflow_database_url to maintain consistency with the naming conventions used in the codebase. This ensures that the code is more readable and easier to understand.
This commit is contained in:
parent
8214b22c09
commit
95b8555503
1 changed files with 4 additions and 3 deletions
|
|
@ -29,8 +29,10 @@ class Settings(BaseSettings):
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
def set_database_url(cls, values):
|
def set_database_url(cls, values):
|
||||||
if "database_url" not in values:
|
if "database_url" not in values:
|
||||||
logger.debug("No database_url provided, trying DATABASE_URL env variable")
|
logger.debug(
|
||||||
if langflow_database_url := os.getenv("langflow_database_url"):
|
"No database_url provided, trying LANGFLOW_DATABASE_URL env variable"
|
||||||
|
)
|
||||||
|
if langflow_database_url := os.getenv("LANGFLOW_DATABASE_URL"):
|
||||||
values["database_url"] = langflow_database_url
|
values["database_url"] = langflow_database_url
|
||||||
else:
|
else:
|
||||||
logger.debug("No DATABASE_URL env variable, using sqlite database")
|
logger.debug("No DATABASE_URL env variable, using sqlite database")
|
||||||
|
|
@ -40,7 +42,6 @@ class Settings(BaseSettings):
|
||||||
class Config:
|
class Config:
|
||||||
validate_assignment = True
|
validate_assignment = True
|
||||||
extra = "ignore"
|
extra = "ignore"
|
||||||
env_prefix = "langflow_"
|
|
||||||
|
|
||||||
@root_validator(allow_reuse=True)
|
@root_validator(allow_reuse=True)
|
||||||
def validate_lists(cls, values):
|
def validate_lists(cls, values):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue