-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.py
More file actions
23 lines (17 loc) · 915 Bytes
/
config.py
File metadata and controls
23 lines (17 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
class Config(object):
# Secret Key Configuration (Either uses Environment Variable or a Hard Coded String)
SECRET_KEY = os.environ.get('SECRET_KEY') or 'as;dlfkja;sdlkjf'
# Obtain Username, Password, and Database Name from Environment Variables
#db_username = os.environ.get('DB_USER')
#db_password = os.environ.get('DB_PASS')
#db_name = os.environ.get('DB_NAME')
db_username = os.environ.get('AWS_DB_USER')
db_password = os.environ.get('AWS_DB_PASS')
db_endpoint = os.environ.get('AWS_DB_ENDPOINT')
db_name = os.environ.get('AWS_DB_NAME')
# SQLAlchemy Database Configuration
#SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{db_username}:{db_password}@localhost:3307/{db_name}'
SQLALCHEMY_DATABASE_URI = f'mysql+pymysql://{db_username}:{db_password}@{db_endpoint}:3306/{db_name}'
SQLALCHEMY_ECHO = True
SQLALCHEMY_TRACK_MODIFICATIONS = False