Spaces:
Sleeping
Sleeping
Update chatbot.py
Browse files- chatbot.py +4 -4
chatbot.py
CHANGED
|
@@ -12,8 +12,8 @@ DATABASE_URL = os.getenv('DATABASE_URL')
|
|
| 12 |
|
| 13 |
# Parse the database URL
|
| 14 |
result = urlparse(DATABASE_URL)
|
| 15 |
-
|
| 16 |
-
|
| 17 |
database = result.path[1:]
|
| 18 |
hostname = result.hostname
|
| 19 |
port = result.port
|
|
@@ -23,8 +23,8 @@ def connect_db():
|
|
| 23 |
try:
|
| 24 |
conn = psycopg2.connect(
|
| 25 |
dbname=database,
|
| 26 |
-
user=
|
| 27 |
-
password=
|
| 28 |
host=hostname,
|
| 29 |
port=port
|
| 30 |
)
|
|
|
|
| 12 |
|
| 13 |
# Parse the database URL
|
| 14 |
result = urlparse(DATABASE_URL)
|
| 15 |
+
db_username = result.username
|
| 16 |
+
db_password = result.password
|
| 17 |
database = result.path[1:]
|
| 18 |
hostname = result.hostname
|
| 19 |
port = result.port
|
|
|
|
| 23 |
try:
|
| 24 |
conn = psycopg2.connect(
|
| 25 |
dbname=database,
|
| 26 |
+
user=db_username,
|
| 27 |
+
password=db_password,
|
| 28 |
host=hostname,
|
| 29 |
port=port
|
| 30 |
)
|