Skip to content
Snippets Groups Projects
Commit 5548c5f6 authored by Michael Bücker's avatar Michael Bücker
Browse files

Update password coding

parent 30e1fc10
No related branches found
No related tags found
No related merge requests found
Pipeline #161155 failed
...@@ -2,6 +2,7 @@ import os ...@@ -2,6 +2,7 @@ import os
from dotenv import load_dotenv from dotenv import load_dotenv
import sqlalchemy import sqlalchemy
import pandas as pd import pandas as pd
from urllib.parse import quote_plus
load_dotenv("/usr/src/app/.env") load_dotenv("/usr/src/app/.env")
...@@ -19,7 +20,7 @@ class Database: ...@@ -19,7 +20,7 @@ class Database:
def db_connect(db_name): def db_connect(db_name):
hostname=os.getenv("DB_HOST") hostname=os.getenv("DB_HOST")
user=os.getenv("DB_USER") user=os.getenv("DB_USER")
password=os.getenv("DB_PASSWORD") password=quote_plus(os.getenv("DB_PASSWORD"))
conn = sqlalchemy.create_engine(f'postgresql+psycopg2://{user}:{password}@{hostname}/{db_name}') conn = sqlalchemy.create_engine(f'postgresql+psycopg2://{user}:{password}@{hostname}/{db_name}')
return conn return conn
......
...@@ -3,4 +3,5 @@ jupyterlab-gitlab==3.0.0 ...@@ -3,4 +3,5 @@ jupyterlab-gitlab==3.0.0
psycopg2-binary psycopg2-binary
psycopg2 psycopg2
python-dotenv python-dotenv
sqlalchemy sqlalchemy
\ No newline at end of file urllib
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment