Make sure that secrets would work on aws
This commit is contained in:
parent
9293c740c9
commit
cbde083ad6
1 changed files with 24 additions and 7 deletions
|
|
@ -15,21 +15,38 @@ load_dotenv()
|
||||||
# # Get the parent directory of your script and add it to sys.path
|
# # Get the parent directory of your script and add it to sys.path
|
||||||
# parent_dir = os.path.dirname(script_dir)
|
# parent_dir = os.path.dirname(script_dir)
|
||||||
# sys.path.append(parent_dir)
|
# sys.path.append(parent_dir)
|
||||||
from ...config import Config
|
# from ...config import Config
|
||||||
config = Config()
|
# config = Config()
|
||||||
config.load()
|
# config.load()
|
||||||
|
|
||||||
|
|
||||||
# in seconds
|
# in seconds
|
||||||
MAX_RETRIES = 3
|
MAX_RETRIES = 3
|
||||||
RETRY_DELAY = 5
|
RETRY_DELAY = 5
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
host = config.postgres_host
|
if os.environ.get('AWS_ENV') == 'prd' or os.environ.get('AWS_ENV') == 'dev':
|
||||||
username = config.postgres_user
|
host = os.environ.get('POSTGRES_PROD_HOST')
|
||||||
password = config.postgres_password
|
username = os.environ.get('POSTGRES_USER')
|
||||||
database_name = config.postgres_db
|
password = os.environ.get('POSTGRES_PASSWORD')
|
||||||
|
database_name = os.environ.get('POSTGRES_DB')
|
||||||
|
elif os.environ.get('AWS_ENV') == 'local':
|
||||||
|
host = os.environ.get('POSTGRES_HOST')
|
||||||
|
username = os.environ.get('POSTGRES_USER')
|
||||||
|
password = os.environ.get('POSTGRES_PASSWORD')
|
||||||
|
database_name = os.environ.get('POSTGRES_DB')
|
||||||
|
else:
|
||||||
|
host = os.environ.get('POSTGRES_HOST')
|
||||||
|
username = os.environ.get('POSTGRES_USER')
|
||||||
|
password = os.environ.get('POSTGRES_PASSWORD')
|
||||||
|
database_name = os.environ.get('POSTGRES_DB')
|
||||||
|
|
||||||
|
# host = config.postgres_host
|
||||||
|
# username = config.postgres_user
|
||||||
|
# password = config.postgres_password
|
||||||
|
# database_name = config.postgres_db
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue