-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.py
35 lines (25 loc) · 863 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
28
29
30
31
32
33
34
35
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
env = os.path.join(basedir, '.env')
if os.path.exists(env):
load_dotenv(env)
else:
print('Warning: .env file not found')
class Config(object):
DEBUG = False
TESTING = False
SECRET_KEY = os.environ.get('SECRET_KEY',
'51f52814-0071-11e6-a247-000ec6c2372c')
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', SECRET_KEY)
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DATABASE_URL', 'sqlite:///' + os.path.join(basedir,
'messages.sqlite'))
SQLALCHEMY_TRACK_MODIFICATIONS = False
class DevConfig(Config):
DEBUG = True
class TestConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = 'sqlite://'
class ProdConfig(Config):
pass