mirror of
https://github.com/devproje/balance-application.git
synced 2024-10-20 15:11:21 +00:00
22 lines
383 B
Python
22 lines
383 B
Python
import os
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
def _load_secret():
|
|
try:
|
|
tok = open("./secret_token.txt", "r").read()
|
|
except:
|
|
return ""
|
|
|
|
return tok
|
|
|
|
conn_param = "host=%s port=%s dbname=%s user=%s password=%s" % (
|
|
os.getenv("DB_URL"),
|
|
os.getenv("DB_PORT"),
|
|
os.getenv("DB_DATABASE"),
|
|
os.getenv("DB_USERNAME"),
|
|
os.getenv("DB_PASSWORD")
|
|
)
|
|
|
|
secret = _load_secret()
|