Added .env logic (finally)

This commit is contained in:
Kikimanox
2022-08-29 13:01:02 +02:00
parent 023d448a28
commit 7cd4004ba9
4 changed files with 16 additions and 16 deletions
+5
View File
@@ -0,0 +1,5 @@
MDB_DATABASE=
MDB_HOST=
MDB_PORT=
MDB_USER=
MDB_PASSWORD=
+6 -14
View File
@@ -1,24 +1,16 @@
import mariadb
import sys
from decouple import config
# todo: DO NOT PUSH THIS TO GIT
database_info = {
'database': '...',
'host': '...',
'port': 0000,
'user': '...',
'password': '...'
'database': config('MDB_DATABASE'),
'host': config('MDB_HOST'),
'port': config('MDB_PORT', cast=int),
'user': config('MDB_USER'),
'password': config('MDB_PASSWORD')
}
# PUT THIS IN INSTEAD WHEN COMMITING, THIS IS ONLY TEMPORARY UNTIL AN .env FILE IS ADDED
database_info_tmp = {
'database': '...',
'host': '...',
'port': 0000,
'user': '...',
'password': '...'
}
# Connect to MariaDB Platform
try: