-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.py
28 lines (19 loc) · 881 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
27
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'), verbose=True)
class Config(object):
TESTING = False
DEBUG = os.environ.get('FLASK_DEBUG', True)
SQLALCHEMY_TRACK_MODIFICATIONS = False
# generate a key in python3.6: python3 -c 'import secrets; print(secrets.token_hex(16))'
SECRET_KEY = os.environ.get('SECRET_KEY', 'this_is_secret')
class production(Config):
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'storage.db')
class development(Config):
SQLALCHEMY_TRACK_MODIFICATIONS = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'storage_dev.db')
class testing(Config):
TESTING = True
SQLALCHEMY_TRACK_MODIFICATIONS = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'storage_test.db')