-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
26 lines (20 loc) · 915 Bytes
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
class Config:
# secret key that will be used for securely signing the session cookie
SECRET_KEY = os.environ.get("SECRET_KEY")
# specifies which type of session interface to use
SESSION_TYPE = os.environ.get("SESSION_TYPE")
# the database URI that should be used for the connection
uri = os.environ.get('DATABASE_URL')
if uri and uri.startswith("postgres://"):
uri = uri.replace("postgres://", "postgresql://", 1)
SQLALCHEMY_DATABASE_URI = uri
else:
raise ValueError("Incorrectly formatted postgres URL")
# Flask-SQLAlchemy will not track modification of objects and emit signals
SQLALCHEMY_TRACK_MODIFICATIONS = False
# MySQL config settings
MYSQL_HOST = os.environ.get("MYSQL_HOST")
MYSQL_USER = os.environ.get("MYSQL_USER")
MYSQL_PASSWORD = os.environ.get("MYSQL_PASSWORD")
MYSQL_DB = os.environ.get("MYSQL_DB")