-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
38 lines (28 loc) · 1.11 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
import os
from datetime import timedelta
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
# app defaults config
CSRF_ENABLED = True
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_TRACK_MODIFICATIONS = os.environ.get('SQLALCHEMY_TRACK_MODIFICATIONS')
OAUTHLIB_INSECURE_TRANSPORT= os.environ.get('OAUTHLIB_INSECURE_TRANSPORT')
# database uri
DEBUG= os.environ.get('DEBUG')
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URI')
# jwt confg
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY')
JWT_COOKIE_SECURE = os.environ.get('JWT_COOKIE_SECURE')
class ProductionConfig(Config):
JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=24)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=30)
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = True
class DevelopmentConfig(Config):
JWT_ACCESS_TOKEN_EXPIRES = timedelta(seconds=5)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=30)
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI')
SESSION_COOKIE_SECURE = False