-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
27 lines (20 loc) · 706 Bytes
/
Copy pathconfig.py
File metadata and controls
27 lines (20 loc) · 706 Bytes
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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY')
if not SECRET_KEY:
print('fatal: no secret key')
exit(1)
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
if not SQLALCHEMY_DATABASE_URI:
print('fatal: no database uri')
exit(1)
SQLALCHEMY_TRACK_MODIFICATIONS = False
CONFIGURATION_FILE = os.environ.get('CONFIGURATION_FILE') or \
os.path.join(basedir, 'config.json')
DATA_DIR = os.environ.get('DATA_DIR')
if not DATA_DIR:
print('fatal: no data dir')
else:
if not os.path.isdir(DATA_DIR):
os.makedirs(DATA_DIR)