Skip to content

Commit

Permalink
Fixed the password and host concat error
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachinbisht27 committed Jan 12, 2024
1 parent 1a66c0d commit ac75af7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@
TESTING = os.environ.get("TESTING")
DEBUG = os.environ.get("DEBUG")

quoted_password = quote(os.environ.get("DB_PASSWORD"))

# Database configuration
POSTGRES = {
"user": os.environ.get("DB_USER"),
"password": os.environ.get("DB_PASSWORD"),
"password": quoted_password,
"database": os.environ.get("DB_NAME"),
"host": os.environ.get("DB_HOST"),
"port": os.environ.get("DB_PORT"),
"connection_name": os.environ.get("CONNECTION_NAME"),
}

quoted_password = quote(POSTGRES["password"])

SQLALCHEMY_DATABASE_URI = (
"postgresql://%(user)s:%(quoted_password)s@%(host)s:%(port)s/%(database)s"
% POSTGRES
"postgresql://%(user)s:%(password)s@%(host)s:%(port)s/%(database)s" % POSTGRES
)

# For socket based connection
Expand Down

0 comments on commit ac75af7

Please sign in to comment.