Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Encoding the password while using it in creating db urls (#190)

Rahul Johnyddbc39e60c58
diff --git a/backend/backend/settings/base.py b/backend/backend/settings/base.py
index 6b9df69a0..de90f5da5 100644
--- a/backend/backend/settings/base.py
+++ b/backend/backend/settings/base.py
@@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/4.2/ref/settings/
import os
from pathlib import Path
from typing import Optional
+from urllib.parse import quote_plus
from dotenv import find_dotenv, load_dotenv
@@ -315,7 +316,8 @@ CELERY_BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}"
# CELERY_RESULT_BACKEND = f"redis://{REDIS_HOST}:{REDIS_PORT}/1"
# Postgres as result backend
CELERY_RESULT_BACKEND = (
- f"db+postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
+ f"db+postgresql://{DB_USER}:{quote_plus(DB_PASSWORD)}"
+ f"@{DB_HOST}:{DB_PORT}/{DB_NAME}"
)
CELERY_ACCEPT_CONTENT = ["json"]
CELERY_TASK_SERIALIZER = "json"
diff --git a/docker/sample.essentials.env b/docker/sample.essentials.env
index 84231722f..b5c6c9ff0 100644
--- a/docker/sample.essentials.env
+++ b/docker/sample.essentials.env
@@ -8,6 +8,7 @@ MINIO_ROOT_PASSWORD=minio123
MINIO_ACCESS_KEY=minio
MINIO_SECRET_KEY=minio123
+# Use encoded password Refer : https://docs.sqlalchemy.org/en/20/core/engines.html#escaping-special-characters-such-as-signs-in-passwords
FLIPT_DB_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable"
QDRANT_USER=unstract_vector_dev