forked from vivekscl/CS2102-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
42 lines (30 loc) · 1.06 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
# from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
# use this .env file to store confidential configurations such as
# heroku config, API keys and remember to put .env into .gitignore
# load_dotenv(os.path.join(basedir, '.env'))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY', os.urandom(24))
DEBUG = False
TESTING = False
SCHEMA_LOCATION = os.environ.get('DEV_SCHEMA_LOCATION', os.path.join(basedir, 'db/schema.sql'))
CONNECTION_FILE = open('conn.txt', 'r').read()
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
DATABASE_NAME = os.environ.get('DEV_DATABASE_NAME', "cs2102")
class TestingConfig(Config):
TESTING = True
DATABASE_NAME = os.environ.get('TEST_DATABASE_NAME', "testdb")
class ProductionConfig(Config):
pass
# (TODO)Set schema location and env for production here
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}