-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.py
More file actions
executable file
·44 lines (36 loc) · 1.08 KB
/
config.py
File metadata and controls
executable file
·44 lines (36 loc) · 1.08 KB
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
43
44
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig(object):
'''
Base config class
'''
DEBUG = True
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'app.db')
BCRYPT_LOG_ROUNDS = 12
SECRET_KEY = os.getenv('SECRET_KEY')
TOKEN_EXPIRATION_DAYS = 36524 # 100 years
TOKEN_EXPIRATION_SECONDS = 0
BYPASS_AUTH = False
class ProductionConfig(BaseConfig):
"""
Production specific config
"""
DEBUG = False
class DevelopmentConfig(BaseConfig):
"""
Development environment specific configuration
"""
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get(
'DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'dev.db')
class TestingConfig(BaseConfig):
TESTING = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'test.db')
BCRYPT_LOG_ROUNDS = 4
TOKEN_EXPIRATION_DAYS = 0
TOKEN_EXPIRATION_SECONDS = 3
BYPASS_AUTH = True